code: public String encodeIntArray(int[] input) throws IOException {
          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          DataOutputStream dos = new DataOutputStream(bos);
          int length = input.length;
          dos.writeInt(length);
          for (int i=0; i < length; i++) {
              dos.writeInt(input[i]);
          }
          
          return new String(Base64.encodeBase64URLSafe(bos.toByteArray()));
      }
docs: Encode the given integer array into Base64 format.
  
  @param input The array of integers to encode
  
  @return The Base64 encoded data
  
  @throws IOException if an error occurs encoding the array stream
  
  @see #decodeIntArray(String)