/** * Decodes data from Base64 notation, automatically detecting * gzip-compressed data and decompressing it. * * @param s * the string to decode * @return the decoded data * @throws java.io.IOException * If there is a problem * @since 1.4 */ public static byte[] decode(String s) throws java.io.IOException { return decode(s, NO_OPTIONS); }
/** * Decodes data from Base64 notation, automatically detecting * gzip-compressed data and decompressing it. * * @param s * the string to decode * @return the decoded data * @throws java.io.IOException * If there is a problem * @since 1.4 */ public static byte[] decode(String s) throws java.io.IOException { return decode(s, NO_OPTIONS); }
/** * Low-level access to decoding ASCII characters in the form of a byte * array. <strong>Ignores GUNZIP option, if it's set.</strong> This is not * generally a recommended method, although it is used internally as part of * the decoding process. Special case: if len = 0, an empty array is * returned. Still, if you need more speed and reduced memory footprint (and * aren't gzipping), consider this method. * * @param source * The Base64 encoded data * @return decoded data * @since 2.3.1 */ public static byte[] decode(byte[] source) throws java.io.IOException { byte[] decoded = null; // try { decoded = decode(source, 0, source.length, Base64.NO_OPTIONS); // } catch( java.io.IOException ex ) { // assert false : // "IOExceptions only come from GZipping, which is turned off: " + // ex.getMessage(); // } return decoded; }
/** * Low-level access to decoding ASCII characters in the form of a byte * array. <strong>Ignores GUNZIP option, if it's set.</strong> This is not * generally a recommended method, although it is used internally as part of * the decoding process. Special case: if len = 0, an empty array is * returned. Still, if you need more speed and reduced memory footprint (and * aren't gzipping), consider this method. * * @param source * The Base64 encoded data * @return decoded data * @since 2.3.1 */ public static byte[] decode(byte[] source) throws java.io.IOException { byte[] decoded = null; // try { decoded = decode(source, 0, source.length, Base64.NO_OPTIONS); // } catch( java.io.IOException ex ) { // assert false : // "IOExceptions only come from GZipping, which is turned off: " + // ex.getMessage(); // } return decoded; }
credentials = new String(Base64.decode(authHeader.substring(x + 1).getBytes(IOUtils.ISO_8859_1)), IOUtils.UTF8); } catch (Exception e) {
byte[] objBytes = decode(encodedObject, options);
byte[] objBytes = decode(encodedObject, options);
bytes = decode(bytes, 0, bytes.length, options);
bytes = decode(bytes, 0, bytes.length, options);