code: def read(self, size=None):
      
      if not self._is_open:
        raise IOError('Not opened.')
  
      if self._current_offset >= self._cpio_archive_file_entry.data_size:
        return b''
  
      file_offset = (
          self._cpio_archive_file_entry.data_offset + self._current_offset)
  
      read_size = self._cpio_archive_file_entry.data_size - self._current_offset
      if read_size > size:
        read_size = size
  
      data = self._cpio_archive_file.ReadDataAtOffset(file_offset, read_size)
  
      # It is possible the that returned data size is not the same as the
      # requested data size. At this layer we don't care and this discrepancy
      # should be dealt with on a higher layer if necessary.
      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.