ParseUtils { public static ByteBuffer parseBase64StringAsByteBuffer(String in) { return ByteBuffer.wrap(Base64.decodeBase64(in.getBytes())); }  static ByteBuffer parseBase64StringAsByteBuffer(String in); static boolean parseStringAsBoolean(String in); static Date parseStringAsDate(String in); static double parseStringAsDouble(String in); static int parseStringAsInt(String in); static UUID parseStringAsUUID(String in); static Long parseStringAsLong(String in);  }
@Test public void testParseBase64StringAsByteBuffer() throws Exception { System.out.println("parseBase64StringAsByteBuffer"); String in = "VGhpcyBpcyBhIGdvb2RseSB0ZXN0IG1lc3NhZ2Uu"; ByteBuffer result = ParseUtils.parseBase64StringAsByteBuffer(in); assertNotNull(result); assertTrue(result.hasArray()); assertTrue(result.hasRemaining()); assertTrue(result.array().length != 0); assertEquals(new String(result.array()), "This is a goodly test message."); }