code: def read(self, size=None):
      
      if not self._is_open:
        raise IOError('Not opened.')
  
      if self._range_offset < 0 or self._range_size < 0:
        raise IOError('Invalid data range.')
  
      if self._current_offset < 0:
        raise IOError(
            'Invalid current offset: {0:d} value less than zero.'.format(
                self._current_offset))
  
      if self._current_offset >= self._range_size:
        return b''
  
      if size is None:
        size = self._range_size
      if self._current_offset + size > self._range_size:
        size = self._range_size - self._current_offset
  
      self._file_object.seek(
          self._range_offset + self._current_offset, os.SEEK_SET)
  
      data = self._file_object.read(size)
  
      self._current_offset += len(data)
  
      return data
docs: Reads a byte string from the file-like object at the current offset.
  
      The function will read a byte string of the specified size or
      all of the remaining data if no size was specified.
  
      Args:
        size (Optional[int]): number of bytes to read, where None is all
            remaining data.
  
      Returns:
        bytes: data read.
  
      Raises:
        IOError: if the read failed.
        OSError: if the read failed.