/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @return the encoded bytes * @since 1.4 */ public static String encodeBytes( byte[] source ) { return encodeBytes( source, 0, source.length, NO_OPTIONS ); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @return the encoded bytes * @since 1.4 */ public static String encodeBytes( byte[] source ) { return encodeBytes( source, 0, source.length, NO_OPTIONS ); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @param off Offset in array where conversion should begin * @param len Length of data to convert * @return the encoded bytes. * @since 1.4 */ public static String encodeBytes( byte[] source, int off, int len ) { return encodeBytes( source, off, len, NO_OPTIONS ); } // end encodeBytes
public static String encodeBase64(byte[] bytes) { return Base64.encodeBytes(bytes); } }
/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @param off Offset in array where conversion should begin * @param len Length of data to convert * @return the encoded bytes. * @since 1.4 */ public static String encodeBytes( byte[] source, int off, int len ) { return encodeBytes( source, off, len, NO_OPTIONS ); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. * <p> * Valid options:<pre> * GZIP: gzip-compresses object before encoding it. * DONT_BREAK_LINES: don't break lines at 76 characters * <i>Note: Technically, this makes your encoding non-compliant.</i> * </pre> * <p> * Example: <code>encodeBytes( myData, Base64.GZIP )</code> or * <p> * Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code> * * * @param source The data to convert * @param options Specified options * @return the encoded bytes. * @see Base64#GZIP * @see Base64#DONT_BREAK_LINES * @since 2.0 */ public static String encodeBytes( byte[] source, int options ) { return encodeBytes( source, 0, source.length, options ); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. * <p> * Valid options:<pre> * GZIP: gzip-compresses object before encoding it. * DONT_BREAK_LINES: don't break lines at 76 characters * <i>Note: Technically, this makes your encoding non-compliant.</i> * </pre> * <p> * Example: <code>encodeBytes( myData, Base64.GZIP )</code> or * <p> * Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code> * * * @param source The data to convert * @param options Specified options * @return the encoded bytes. * @see Base64#GZIP * @see Base64#DONT_BREAK_LINES * @since 2.0 */ public static String encodeBytes( byte[] source, int options ) { return encodeBytes( source, 0, source.length, options ); } // end encodeBytes
result = Base64.encodeBytes(rawHmac); } catch (Exception e) { throw XProcException.dynamicError(36,"Failed to generate HMAC : " + e.getMessage());
result = Base64.encodeBytes(rawHmac);
readLen -= len; if (readLen == 0) { String encoded = Base64.encodeBytes(bytes); tree.addText(encoded); pos = 0; byte lastBytes[] = new byte[pos]; System.arraycopy(bytes, 0, lastBytes, 0, pos); tree.addText(Base64.encodeBytes(lastBytes));
readLen -= len; if (readLen == 0) { String encoded = Base64.encodeBytes(bytes); tree.addText(encoded); pos = 0; byte lastBytes[] = new byte[pos]; System.arraycopy(bytes, 0, lastBytes, 0, pos); tree.addText(Base64.encodeBytes(lastBytes));
while (read >= 0) { if (read > 0) { String base64 = Base64.encodeBytes(bytes, 0, read); tree.addText(base64 + "\n");
readLen -= len; if (readLen == 0) { tree.addText(Base64.encodeBytes(bytes)); pos = 0; readLen = bufSize; byte lastBytes[] = new byte[pos]; System.arraycopy(bytes, 0, lastBytes, 0, pos); tree.addText(Base64.encodeBytes(lastBytes));
readLen -= len; if (readLen == 0) { tree.addText(Base64.encodeBytes(bytes)); pos = 0; readLen = bufSize; byte lastBytes[] = new byte[pos]; System.arraycopy(bytes, 0, lastBytes, 0, pos); tree.addText(Base64.encodeBytes(lastBytes));
while (read >= 0) { if (read > 0) { String base64 = Base64.encodeBytes(bytes, 0, read); tree.addText(base64 + "\n");
String base64 = Base64.encodeBytes(bytes, 0, pos); tree.addText(base64 + "\n"); pos = 0;
String base64 = Base64.encodeBytes(bytes, 0, pos); tree.addText(base64 + "\n"); pos = 0;
public void returnData(ByteArrayOutputStream baos) { // We're only called if the output is compressed TreeWriter tree = new TreeWriter(runtime); tree.startDocument(step.getNode().getBaseURI()); tree.addStartElement(XProcConstants.c_data); tree.addAttribute(_encoding, "base64"); tree.addAttribute(_content_type, "application/x-gzip"); tree.startContent(); tree.addText(Base64.encodeBytes(baos.toByteArray())); tree.addEndElement(); tree.endDocument(); result.write(tree.getResult()); }
public void returnData(ByteArrayOutputStream baos) { // We're only called if the output is compressed TreeWriter tree = new TreeWriter(runtime); tree.startDocument(step.getNode().getBaseURI()); tree.addStartElement(XProcConstants.c_data); tree.addAttribute(_encoding, "base64"); tree.addAttribute(_content_type, "application/x-gzip"); tree.startContent(); tree.addText(Base64.encodeBytes(baos.toByteArray())); tree.addEndElement(); tree.endDocument(); result.write(tree.getResult()); }