code: private InputStream readFromInMemorySegment(DirectSegmentAccess segment, long startOffset, long endOffset, TimeoutTimer timer) {
          long readOffset = startOffset;
          long remainingLength = endOffset - startOffset;
          ArrayList<InputStream> inputs = new ArrayList<>();
          while (remainingLength > 0) {
              int readLength = (int) Math.min(remainingLength, Integer.MAX_VALUE);
              try (ReadResult readResult = segment.read(readOffset, readLength, timer.getRemaining())) {
                  inputs.addAll(readResult.readRemaining(readLength, timer.getRemaining()));
                  assert readResult.getConsumedLength() == readLength : "Expecting a full read (from memory).";
                  remainingLength -= readResult.getConsumedLength();
                  readOffset += readResult.getConsumedLength();
              }
          }
  
          return new SequenceInputStream(Iterators.asEnumeration(inputs.iterator()));
      }
docs: Reads from the Segment between the given offsets. This method assumes all the data is readily available in the cache,
  otherwise it will block synchronously for Storage retrieval.
  
  @param segment     The Segment to read from.
  @param startOffset The offset to start reading from.
  @param endOffset   The offset to stop reading at.
  @param timer       Timer for the operation.
  @return An Enumeration of InputStreams representing the read data.