BinaryType implements Binary { @Override public boolean isZeros() { for (byte b : this.data) { if (b != 0) { return false; } } return true; } 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 public void testStringConstructor() { BinaryType blob = new Blob(SAMPLE_BLOB_BASE64); verifyBlob8ByteHexAndBase64(blob); assertThat(blob.isZeros()).isFalse(); }
@Test public void testByteConstructor() { BinaryType blob = new Blob(SAMPLE_BLOB_DATA); verifyBlob8ByteHexAndBase64(blob); assertThat(blob.isZeros()).isFalse(); }