ByteBuff cloneUncompressedBufferWithHeader() {
      expectState(State.BLOCK_READY);
      ByteBuff bytebuff = allocator.allocate(baosInMemory.size());
      baosInMemory.toByteBuff(bytebuff);
      int numBytes = (int) ChecksumUtil.numBytes(onDiskBlockBytesWithHeader.size(),
        fileContext.getBytesPerChecksum());
      putHeader(bytebuff, onDiskBlockBytesWithHeader.size() + numBytes, baosInMemory.size(),
        onDiskBlockBytesWithHeader.size());
      bytebuff.rewind();
      return bytebuff;
    }
Clones the header followed by the uncompressed data, even if using compression. This is
needed for storing uncompressed blocks in the block cache. Can be called in the "writing"
state or the "block ready" state. Returns only the header and data, does not include checksum
data.
@return Returns an uncompressed block ByteBuff for caching on write
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java