@Test public void testBase64() throws Exception { Random random = new Random(); for (int i = 0; i < 4567; i++) { byte[] buf = new byte[i]; random.nextBytes(buf); ByteArrayInputStream in = new ByteArrayInputStream( buf ); Base64InputStream base64 = new Base64InputStream(in,true); byte[] enc = Util.streamToBytes(base64); in = new ByteArrayInputStream( enc ); base64 = new Base64InputStream(in); byte[] dec = Util.streamToBytes(base64); boolean result = Arrays.equals(buf, dec); if (!result) { System.out.println(); System.out.println("testBase64 Failed on : " + i); } assertTrue(result); } for (int i = 5; i < 50; i++) { int testSize = (i * 1000) + 123; byte[] buf = new byte[testSize]; random.nextBytes(buf); ByteArrayInputStream in = new ByteArrayInputStream( buf ); Base64InputStream base64 = new Base64InputStream(in,true); byte[] enc = Util.streamToBytes(base64); in = new ByteArrayInputStream( enc ); base64 = new Base64InputStream(in); byte[] dec = Util.streamToBytes(base64); boolean result = Arrays.equals(buf, dec); if (!result) { System.out.println(); System.out.println("testBase64 Failed on : " + testSize); } assertTrue(result); } }
public Base64() { this(false); }
Base64 { public Base64() { this(false); } }
Base64 { public Base64() { this(false); } Base64();  Base64(boolean urlSafe);  Base64(int lineLength);  Base64(int lineLength, byte[] lineSeparator);  Base64(int lineLength, byte[] lineSeparator, boolean urlSafe); }
Base64 { public Base64() { this(false); } Base64();  Base64(boolean urlSafe);  Base64(int lineLength);  Base64(int lineLength, byte[] lineSeparator);  Base64(int lineLength, byte[] lineSeparator, boolean urlSafe); boolean isUrlSafe(); static boolean isBase64(byte octet); static boolean isArrayByteBase64(byte[] arrayOctet); static byte[] encodeBase64(byte[] binaryData); static String encodeBase64String(byte[] binaryData); static byte[] encodeBase64URLSafe(byte[] binaryData); static String encodeBase64URLSafeString(byte[] binaryData); static byte[] encodeBase64Chunked(byte[] binaryData); Object decode(Object pObject); byte[] decode(String pArray); byte[] decode(byte[] pArray); static byte[] encodeBase64(byte[] binaryData, boolean isChunked); static byte[] encodeBase64(byte[] binaryData, boolean isChunked, boolean urlSafe); static byte[] encodeBase64(byte[] binaryData, boolean isChunked, boolean urlSafe, int maxResultSize); static byte[] decodeBase64(String base64String); static byte[] decodeBase64(byte[] base64Data); Object encode(Object pObject); String encodeToString(byte[] pArray); byte[] encode(byte[] pArray); static BigInteger decodeInteger(byte[] pArray); static byte[] encodeInteger(BigInteger bigInt); }
Base64 { public Base64() { this(false); } Base64();  Base64(boolean urlSafe);  Base64(int lineLength);  Base64(int lineLength, byte[] lineSeparator);  Base64(int lineLength, byte[] lineSeparator, boolean urlSafe); boolean isUrlSafe(); static boolean isBase64(byte octet); static boolean isArrayByteBase64(byte[] arrayOctet); static byte[] encodeBase64(byte[] binaryData); static String encodeBase64String(byte[] binaryData); static byte[] encodeBase64URLSafe(byte[] binaryData); static String encodeBase64URLSafeString(byte[] binaryData); static byte[] encodeBase64Chunked(byte[] binaryData); Object decode(Object pObject); byte[] decode(String pArray); byte[] decode(byte[] pArray); static byte[] encodeBase64(byte[] binaryData, boolean isChunked); static byte[] encodeBase64(byte[] binaryData, boolean isChunked, boolean urlSafe); static byte[] encodeBase64(byte[] binaryData, boolean isChunked, boolean urlSafe, int maxResultSize); static byte[] decodeBase64(String base64String); static byte[] decodeBase64(byte[] base64Data); Object encode(Object pObject); String encodeToString(byte[] pArray); byte[] encode(byte[] pArray); static BigInteger decodeInteger(byte[] pArray); static byte[] encodeInteger(BigInteger bigInt);  }