### Question:
Snappy { public static int calculateChecksum(ByteBuf data) { return calculateChecksum(data, data.readerIndex(), data.readableBytes()); }  void reset(); void encode(ByteBuf in, ByteBuf out, int length); void decode(ByteBuf in, ByteBuf out); static int calculateChecksum(ByteBuf data); static int calculateChecksum(ByteBuf data, int offset, int length);  }### Answer:
@Test public void testCalculateChecksum() { ByteBuf input = Unpooled.wrappedBuffer(new byte[] { 'n', 'e', 't', 't', 'y' }); assertEquals(maskChecksum(0xd6cb8b55), calculateChecksum(input)); }