def read(self, reader, count):
      """Reads some values from the buffer"""
      indexBeforeRead = reader.index
      indexAfterRead = reader.index + count
      if indexBeforeRead < self.buffer_start:
          raise InvalidReaderException()
      if indexAfterRead > self.buffer_end:
          if self.eof:
              raise EndOfStreamException()
          else:
               self.populateBuffer(indexAfterRead)
      result = self.getBufferContents(indexBeforeRead, indexAfterRead)
      reader.index = indexAfterRead
      self.trimBuffer(indexBeforeRead)
      return result
Reads some values from the buffer
recipes/Python/392150_Buffered_Stream_Multiple_ForwardOnly/recipe-392150.py