public static DiskRangeInfo createDiskRangeInfo(ColumnStreamData streamBuffer) {
    DiskRangeInfo diskRangeInfo = new DiskRangeInfo(streamBuffer.getIndexBaseOffset());
    long offset = streamBuffer.getIndexBaseOffset(); // See ctor comment.
    // TODO: we should get rid of this
    for (MemoryBuffer memoryBuffer : streamBuffer.getCacheBuffers()) {
      ByteBuffer buffer = memoryBuffer.getByteBufferDup();
      diskRangeInfo.addDiskRange(new BufferChunk(buffer, offset));
      offset += buffer.remaining();
    }
    return diskRangeInfo;
  }
Converts stream buffers to disk ranges.
@param streamBuffer - stream buffer
@return - total length of disk ranges
ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/StreamUtils.java