/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @return Base64 String * @since 1.4 */ public static String encodeBytes(final byte[] source) { return Base64.encodeBytes(source, 0, source.length, Base64.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 Encoded String * @since 1.4 */ public static String encodeBytes(final byte[] source, final int off, final int len) { return Base64.encodeBytes(source, off, len, Base64.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 Encoded String * @see Base64#GZIP * @see Base64#DONT_BREAK_LINES * @since 2.0 */ public static String encodeBytes(final byte[] source, final int options) { return Base64.encodeBytes(source, 0, source.length, options); } // end encodeBytes
public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException { try { final String concat = secretKey + magicNumber; final MessageDigest digest = MessageDigest.getInstance("SHA1"); digest.update(concat.getBytes(StandardCharsets.UTF_8)); final byte[] bytes = digest.digest(); return encodeBytes(bytes); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } } }
public static String toBase64String(final Xid xid) { byte[] data = XidImpl.toByteArray(xid); return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE); }
/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @return Base64 String * @since 1.4 */ public static String encodeBytes(final byte[] source) { return Base64.encodeBytes(source, 0, source.length, Base64.NO_OPTIONS); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @return Base64 String * @since 1.4 */ public static String encodeBytes(final byte[] source) { return Base64.encodeBytes(source, 0, source.length, Base64.NO_OPTIONS); } // end encodeBytes
/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @return Base64 String * @since 1.4 */ public static String encodeBytes(final byte[] source) { return Base64.encodeBytes(source, 0, source.length, Base64.NO_OPTIONS); } // end encodeBytes
protected static String encode(final byte[] data) { return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE); } }
/** * 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 Encoded String * @since 1.4 */ public static String encodeBytes(final byte[] source, final int off, final int len) { return Base64.encodeBytes(source, off, len, Base64.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 Encoded String * @since 1.4 */ public static String encodeBytes(final byte[] source, final int off, final int len) { return Base64.encodeBytes(source, off, len, Base64.NO_OPTIONS); } // end encodeBytes
protected static String encode(final byte[] data) { return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE); } }
public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException { try { final String concat = secretKey + magicNumber; final MessageDigest digest = MessageDigest.getInstance("SHA1"); digest.update(concat.getBytes(StandardCharsets.UTF_8)); final byte[] bytes = digest.digest(); return encodeBytes(bytes); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } } }
public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException { try { final String concat = secretKey + magicNumber; final MessageDigest digest = MessageDigest.getInstance("SHA1"); digest.update(concat.getBytes(StandardCharsets.UTF_8)); final byte[] bytes = digest.digest(); return encodeBytes(bytes); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } } }
public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException { try { final String concat = secretKey + magicNumber; final MessageDigest digest = MessageDigest.getInstance("SHA1"); digest.update(concat.getBytes(StandardCharsets.UTF_8)); final byte[] bytes = digest.digest(); return encodeBytes(bytes); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } } }
public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException { try { final String concat = secretKey + magicNumber; final MessageDigest digest = MessageDigest.getInstance("SHA1"); digest.update(concat.getBytes(StandardCharsets.UTF_8)); final byte[] bytes = digest.digest(); return encodeBytes(bytes); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } } }
public static String createExpectedResponse(final String magicNumber, final String secretKey) throws IOException { try { final String concat = secretKey + magicNumber; final MessageDigest digest = MessageDigest.getInstance("SHA1"); digest.update(concat.getBytes(StandardCharsets.UTF_8)); final byte[] bytes = digest.digest(); return encodeBytes(bytes); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } } }
public static String toBase64String(final Xid xid) { byte[] data = XidImpl.toByteArray(xid); return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE); }
public static String toBase64String(final Xid xid) { byte[] data = XidImpl.toByteArray(xid); return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE); }
public static String toBase64String(final Xid xid) { byte[] data = XidImpl.toByteArray(xid); return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE); }