code: def read(self, size=None):  # pylint: disable=invalid-name
          
          if size is None or size < 0:
              raise exceptions.NotYetImplementedError(
                  'Illegal read of size %s requested on BufferedStream. '
                  'Wrapped stream %s is at position %s-%s, '
                  '%s bytes remaining.' %
                  (size, self.__stream, self.__start_pos, self.__end_pos,
                   self._bytes_remaining))
  
          data = ''
          if self._bytes_remaining:
              size = min(size, self._bytes_remaining)
              data = self.__buffered_data[
                  self.__buffer_pos:self.__buffer_pos + size]
              self.__buffer_pos += size
          return data
docs: Reads from the buffer.