/** * Decode base64 encoded data. * * @param chars the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(char[] chars, OutputStream out) throws IOException { decode(chars, 0, chars.length, out); }
/** * Decode base64 encoded data. * * @param chars the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(char[] chars, OutputStream out) throws IOException { decode(chars, 0, chars.length, out); }
/** * Decode base64 encoded data. * * @param chars the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(char[] chars, OutputStream out) throws IOException { decode(chars, 0, chars.length, out); }
/** * Decode base64 encoded data. * * @param chars the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(char[] chars, OutputStream out) throws IOException { decode(chars, 0, chars.length, out); }
/** * Decode base64 encoded data. * * @param data the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(String data, OutputStream out) throws IOException { char[] chars = data.toCharArray(); decode(chars, 0, chars.length, out); }
/** * Decode base64 encoded data. The data read from the inputstream is * assumed to be of charset "US-ASCII". * * @param in inputstream of the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(InputStream in, OutputStream out) throws IOException { decode(new InputStreamReader(in, CHARSET), out); }
/** * Decode base64 encoded data. The data read from the inputstream is * assumed to be of charset "US-ASCII". * * @param in inputstream of the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(InputStream in, OutputStream out) throws IOException { decode(new InputStreamReader(in, CHARSET), out); }
/** * Decode base64 encoded data. * * @param data the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(String data, OutputStream out) throws IOException { char[] chars = data.toCharArray(); decode(chars, 0, chars.length, out); }
/** * Decode base64 encoded data. The data read from the inputstream is * assumed to be of charset "US-ASCII". * * @param in inputstream of the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(InputStream in, OutputStream out) throws IOException { decode(new InputStreamReader(in, CHARSET), out); }
/** * Decode base64 encoded data. * * @param data the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(String data, OutputStream out) throws IOException { char[] chars = data.toCharArray(); decode(chars, 0, chars.length, out); }
/** * Decode base64 encoded data. * * @param data the base64 encoded data to be decoded * @param out stream where the decoded data should be written to * @throws java.io.IOException if an i/o error occurs */ public static void decode(String data, OutputStream out) throws IOException { char[] chars = data.toCharArray(); decode(chars, 0, chars.length, out); }
/** * From a base 64 representation, returns the corresponding byte[] * @param data String The base64 representation * @return byte[] * @throws IOException * @throws IOException */ public static byte[] base64ToByte(String data) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); Base64.decode(data, out); return out.toByteArray(); }
private void fillBuffer() throws IOException { int len = reader.read(chars, 0, BUFFER_SIZE); if (len < 0) { remaining = -1; return; } Base64.decode(chars, 0, len, out); buffer = out.toByteArray(); pos = 0; remaining = buffer.length; out.reset(); }
private void fillBuffer() throws IOException { int len = reader.read(chars, 0, BUFFER_SIZE); if (len < 0) { remaining = -1; return; } Base64.decode(chars, 0, len, out); buffer = out.toByteArray(); pos = 0; remaining = buffer.length; out.reset(); }
private void fillBuffer() throws IOException { int len = reader.read(chars, 0, BUFFER_SIZE); if (len < 0) { remaining = -1; return; } Base64.decode(chars, 0, len, out); buffer = out.toByteArray(); pos = 0; remaining = buffer.length; out.reset(); }
@Override public Blob deserialize(String value) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); StringReader reader = new StringReader(value); try { Base64.decode(reader, baos); } catch (IOException e) { throw new RuntimeException(e); } return new ArrayBasedBlob(baos.toByteArray()); } }
private String retrieveString() throws IOException { String value = retrieve(); if (base64) { ByteArrayOutputStream out = new ByteArrayOutputStream(); Base64.decode(value, out); value = new String(out.toByteArray(), "UTF-8"); } return value; }
private String retrieveString() throws IOException { String value = retrieve(); if (base64) { ByteArrayOutputStream out = new ByteArrayOutputStream(); Base64.decode(value, out); value = new String(out.toByteArray(), StandardCharsets.UTF_8); } return value; }
private String retrieveString() throws IOException { String value = retrieve(); if (base64) { ByteArrayOutputStream out = new ByteArrayOutputStream(); Base64.decode(value, out); value = new String(out.toByteArray(), StandardCharsets.UTF_8); } return value; }
private String retrieveString() throws IOException { String value = retrieve(); if (base64) { ByteArrayOutputStream out = new ByteArrayOutputStream(); Base64.decode(value, out); value = new String(out.toByteArray(), "UTF-8"); } return value; }