/** * Decodes data from Base64 notation, automatically detecting gzip-compressed data and decompressing it. * * @param s the string to decode * @return the decoded data */ public static byte[] decode( String s ) { return decode(s, NO_OPTIONS); }
byte[] objBytes = decode(encodedObject);
private Value decodeValue( String encodedValue, ValueFactory valueFactory ) throws RepositoryException { byte[] binaryValue = Base64.decode(encodedValue); InputStream stream = new ByteArrayInputStream(binaryValue); try { return valueFactory.createValue(stream); } finally { try { stream.close(); } catch (IOException e) { // Error accessing the value, so throw this ... throw new RepositoryException(e); } } }
bytes = decode(bytes, 0, bytes.length, options);