private static void copyUncompressedChunk(ByteBuffer src, ByteBuffer dest) {
    int startPos = dest.position(), startLim = dest.limit();
    dest.put(src); // Copy uncompressed data to cache.
    // Put call moves position forward by the size of the data.
    int newPos = dest.position();
    if (newPos > startLim) {
      throw new AssertionError("After copying, buffer [" + startPos + ", " + startLim
          + ") became [" + newPos + ", " + dest.limit() + ")");
    }
    dest.position(startPos);
    dest.limit(newPos);
  }
To achieve some sort of consistent cache boundaries, we will cache streams deterministically;
in segments starting w/stream start, and going for either stream size or some fixed size.
If we are not reading the entire segment's worth of data, then we will not cache the partial
RGs; the breakage of cache assumptions (no interleaving blocks, etc.) is way too much PITA
to handle just for this case.
We could avoid copy in non-zcr case and manage the buffer that was not allocated by our
allocator. Uncompressed case is not mainline though so let's not complicate it.
@param kind
ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java