public ExtendedCellScanner createCellScanner(final Codec codec, final CompressionCodec compressor,
    final byte[] cellBlock) throws IOException {
    // Use this method from Client side to create the CellScanner
    if (compressor != null) {
      ByteBuffer cellBlockBuf = decompress(compressor, cellBlock);
      return codec.getDecoder(new ByteBufferInputStream(cellBlockBuf));
    }
    // Not making the Decoder over the ByteBuffer purposefully. The Decoder over the BB will
    // make Cells directly over the passed BB. This method is called at client side and we don't
    // want the Cells to share the same byte[] where the RPC response is being read. Caching of any
    // of the Cells at user's app level will make it not possible to GC the response byte[]
    return codec.getDecoder(new ByteArrayInputStream(cellBlock));
  }
Create a cell scanner.
@param codec     to use for cellblock
@param cellBlock to encode
@return CellScanner to work against the content of <code>cellBlock</code>
@throws IOException if encoding fails
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/CellBlockBuilder.java