public static String encode ( byte [ ] in ) { StringBuilder builder = new StringBuilder ( 4 * ( ( in . length + 2 ) / 3 ) ) ; byte [ ] encoded = encodeAsBytes ( in ) ; for ( int i = 0 ; i < encoded . length ; i ++ ) { builder . append ( code [ encoded [ i ] + 1 ] ) ; if ( i % 72 == 71 ) builder . append ( "\n" ) ; } return builder . toString ( ) ; }
Encode a byte array and return the encoded string .