tried to implement BufferSegmentReader