Base32Codec() { super(alphabets()); }
/** * Decodes the given base 32 encoded bytes. */ public static byte[] decode(byte[] b32) { return b32 == null || b32.length == 0 ? b32 : codec.decode(b32, b32.length); } }
/** * Returns a 32 encoded byte array of the given bytes. */ public static byte[] encode(byte[] bytes) { return bytes == null || bytes.length == 0 ? bytes : codec.encode(bytes); }
/** * Returns a base 32 encoded string of the given bytes. */ public static String encodeAsString(byte ... bytes) { if (bytes == null) return null; return bytes.length == 0 ? "" : CodecUtils.toStringDirect(codec.encode(bytes)); }
/** * Decodes the given base 32 encoded string, * skipping carriage returns, line feeds and spaces as needed. */ public static byte[] decode(String b32) { if (b32 == null) return null; if (b32.length() == 0) return new byte[0]; byte[] buf = new byte[b32.length()]; int len = CodecUtils.sanitize(b32, buf); return codec.decode(buf, len); }
Base32Codec() { super(alphabets()); }
/** * @param bytes the bytes. * @return a 32 encoded byte array of the given bytes. hchar: compared to * Base32.encode(byte[]) of JakartaCommons-1.5, this routine is > 20x faster * on my MacAir. */ public static byte[] encode(byte[] bytes) { return bytes == null || bytes.length == 0 ? bytes : CODEC.encode(bytes); }
/** * Decodes the given base 32 encoded bytes. */ public static byte[] decode(byte[] b32) { return b32 == null || b32.length == 0 ? b32 : codec.decode(b32, b32.length); } }
Base32Codec() { super(alphabets()); }
/** * Returns a 32 encoded byte array of the given bytes. */ public static byte[] encode(byte[] bytes) { return bytes == null || bytes.length == 0 ? bytes : codec.encode(bytes); }
/** * Decodes the given base 32 encoded bytes. * @param b32 the base 32 encoded bytes. * @return the decoded result. */ public static byte[] decode(byte[] b32) { return b32 == null || b32.length == 0 ? b32 : CODEC.decode(b32, b32.length); } }
Base32Codec() { super(alphabets()); }
/** * Returns a base 32 encoded string of the given bytes. */ public static String encodeAsString(byte ... bytes) { if (bytes == null) return null; return bytes.length == 0 ? "" : CodecUtils.toStringDirect(codec.encode(bytes)); }
/** * Decodes the given base 32 encoded string, * skipping carriage returns, line feeds and spaces as needed. */ public static byte[] decode(String b32) { if (b32 == null) return null; if (b32.length() == 0) return new byte[0]; byte[] buf = new byte[b32.length()]; int len = CodecUtils.sanitize(b32, buf); return codec.decode(buf, len); }
Base32Codec() { super(alphabets()); }
/** * @param bytes the bytes. * @return a base 32 encoded string of the given bytes. */ public static String encodeAsString(byte... bytes) { if (bytes == null) { return null; } return bytes.length == 0 ? "" : CodecUtils.toStringDirect(CODEC.encode(bytes)); }
/** * Decodes the given base 32 encoded string, skipping carriage returns, line * feeds and spaces as needed. hchar: compared to Base32.decode(String) of * JakartaCommons-1.5, this routine is > 11x faster on my MacAir. * @param b32 the base 32 encoded string. * @return the decoded result. */ public static byte[] decode(String b32) { if (b32 == null) { return null; } if (b32.length() == 0) { return new byte[0]; } byte[] buf = new byte[b32.length()]; int len = CodecUtils.sanitize(b32, buf); return CODEC.decode(buf, len); }
Base32Codec() { super(alphabets()); }
/** * @param bytes the bytes. * @return a 32 encoded byte array of the given bytes. hchar: compared to * Base32.encode(byte[]) of JakartaCommons-1.5, this routine is > 20x faster * on my MacAir. */ public static byte[] encode(byte[] bytes) { return bytes == null || bytes.length == 0 ? bytes : CODEC.encode(bytes); }
/** * Decodes the given base 32 encoded bytes. * @param b32 the base 32 encoded bytes. * @return the decoded result. */ public static byte[] decode(byte[] b32) { return b32 == null || b32.length == 0 ? b32 : CODEC.decode(b32, b32.length); } }