BinaryType implements Binary { @Override public String toString() { return getBase64(); } BinaryType(byte[] data);  BinaryType(String base64); @Override byte[] getData(); @Override void getData(byte[] buffer, int offset); @Override int getLength(); @Override String getHex(); @Override String getBase64(); @Override boolean isZeros(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static byte[] parseHex(String hex); static String formatHex(byte[] data); static byte[] parseBase64(String base64); static String formatBase64(byte[] data); static byte[] toBytes(long value); static byte[] toBytes(int value); static long toLong(byte[] data); static long toInt(byte[] data);  }
@Test(expected = IllegalArgumentException.class) public void testStringConstructorTooLong() { StringBuilder buffer = new StringBuilder(LENGTH_MAX * 2); for (int i = 0; i <= LENGTH_MAX; i++) { String hex = Integer.toHexString(i); if (hex.length() < 2) { hex = "0" + hex; } buffer.append(hex); } new Blob(buffer.toString()); }