private void testEncodingInternals(boolean useTag) throws IOException {
    // usually we have just block without headers, but don't complicate that
    List<KeyValue> kvs = generator.generateTestKeyValues(60, useTag);
    HFileBlock block = getSampleHFileBlock(kvs, useTag);
    HFileBlock blockOnDisk = createBlockOnDisk(conf, kvs, block, useTag);

    if (blockEncoder.getDataBlockEncoding() != DataBlockEncoding.NONE) {
      assertEquals(BlockType.ENCODED_DATA, blockOnDisk.getBlockType());
      assertEquals(blockEncoder.getDataBlockEncoding().getId(),
        blockOnDisk.getDataBlockEncodingId());
    } else {
      assertEquals(BlockType.DATA, blockOnDisk.getBlockType());
    }
  }
Test encoding with offheap keyvalue. This test just verifies if the encoders work with DBB and
does not use the getXXXArray() API
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileDataBlockEncoder.java