DataChecksum implements Checksum { @Override public String toString() { return "DataChecksum(type=" + type + ", chunkSize=" + bytesPerChecksum + ")"; } private  DataChecksum( Type type, Checksum checksum, int chunkSize ); static Checksum newCrc32(); static int getCrcPolynomialForType(Type type); static DataChecksum newDataChecksum(Type type, int bytesPerChecksum ); static DataChecksum newDataChecksum( byte bytes[], int offset ); static DataChecksum newDataChecksum( DataInputStream in ); void writeHeader( DataOutputStream out ); byte[] getHeader(); int writeValue( DataOutputStream out, boolean reset ); int writeValue( byte[] buf, int offset, boolean reset ); boolean compare( byte buf[], int offset ); Type getChecksumType(); int getChecksumSize(); int getChecksumSize(int dataSize); int getBytesPerChecksum(); int getNumBytesInSum(); static int getChecksumHeaderSize(); @Override long getValue(); @Override void reset(); @Override void update( byte[] b, int off, int len ); @Override void update( int b ); void verifyChunkedSums(ByteBuffer data, ByteBuffer checksums,
      String fileName, long basePos); void calculateChunkedSums(ByteBuffer data, ByteBuffer checksums); void calculateChunkedSums(
      byte[] data, int dataOffset, int dataLength,
      byte[] sums, int sumsOffset); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); static final int CHECKSUM_NULL; static final int CHECKSUM_CRC32; static final int CHECKSUM_CRC32C; static final int CHECKSUM_DEFAULT; static final int CHECKSUM_MIXED; static final int SIZE_OF_INTEGER; }
@Test public void testToString() { assertEquals("DataChecksum(type=CRC32, chunkSize=512)", DataChecksum.newDataChecksum(DataChecksum.Type.CRC32, 512).toString()); }