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 ( ) ) ) ; }
Encode the given integer array into Base64 format .