code: def read(self, size=None):
          
          data = EMPTY
  
          if size == 0:
              return data
  
          while True:
              if size and len(data) >= size:
                  return data
  
              if not self.buffer:
                  self._fetch()
                  if not self.buffer:
                      # EOF
                      return data
  
              if size:
                  remaining = size - len(data)
                  data += self.buffer[:remaining]
                  self.buffer = self.buffer[remaining:]
              else:
                  data += self.buffer
                  self.buffer = EMPTY
docs: Read a chunk from rfile buffer and return it.
  
          Args:
              size (int): amount of data to read
  
          Returns:
              bytes: Chunk from rfile, limited by size if specified.