Base64 { public static String encode( byte[] data ) { return BaseEncoding.base64Url().omitPadding().encode( data ); }  static String encode( byte[] data ); static byte[] decode( String data );  }
@Test public void testEncode() throws Exception { byte[] data = new byte[1]; for (int i = -128; i < 127; i++) { data[0] = (byte)i; String encoded = Base64.encode( data ); System.out.printf( "%s\n", encoded ); assertFalse( encoded.contains( "~" ) ); assertFalse( encoded.contains( "+" ) ); assertFalse( encoded.contains( "/" ) ); assertFalse( encoded.contains( "=" ) ); } }