parameters: (self, n=1)
return_statement: return self._readbuffer[self._offset: self._offset + 512]
docstring: Returns buffered bytes without advancing the position.
docstring_summary: Returns buffered bytes without advancing the position.
docstring_tokens: Returns buffered bytes without advancing the position .
function: def peek(self, n=1):
          """Returns buffered bytes without advancing the position."""
          if n > len(self._readbuffer) - self._offset:
              chunk = self.read(n)
              if len(chunk) > self._offset:
                  self._readbuffer = chunk + self._readbuffer[self._offset:]
                  self._offset = 0
              else:
                  self._offset -= len(chunk)
  
          # Return up to 512 bytes to reduce allocation overhead for tight loops.
          return self._readbuffer[self._offset: self._offset + 512]
function_tokens: def peek ( self , n = 1 ) : if n > len ( self . _readbuffer ) - self . _offset : chunk = self . read ( n ) if len ( chunk ) > self . _offset : self . _readbuffer = chunk + self . _readbuffer [ self . _offset : ] self . _offset = 0 else : self . _offset -= len ( chunk ) # Return up to 512 bytes to reduce allocation overhead for tight loops. return self . _readbuffer [ self . _offset : self . _offset + 512 ]