/** * Creates a byte string from a hexadecimal or binary string. * * <p>For example, <code>of("DEAD", 16)</code> * returns the same as {@code ByteString(new byte[] {0xDE, 0xAD})}. * * @param string Array of bytes * @param base Base (2 or 16) * @return String */ public static ByteString of(String string, int base) { final byte[] bytes = parse(string, base); return new ByteString(bytes, false); }
/** * Creates a byte string from a hexadecimal or binary string. * * <p>For example, <code>of("DEAD", 16)</code> * returns the same as {@code ByteString(new byte[] {0xDE, 0xAD})}. * * @param string Array of bytes * @param base Base (2 or 16) * @return String */ public static ByteString of(String string, int base) { final byte[] bytes = parse(string, base); return new ByteString(bytes, false); }
/** * Creates a byte string from a hexadecimal or binary string. * * <p>For example, <tt>of("DEAD", 16)</tt> * returns the same as {@code ByteString(new byte[] {0xDE, 0xAD})}. * * @param string Array of bytes * @param base Base (2 or 16) * @return String */ public static ByteString of(String string, int base) { final byte[] bytes = parse(string, base); return new ByteString(bytes, false); }