docstr: Read at most 'n' bytes from the buffer, or less if the read
  hits EOF before obtaining 'n' bytes.
  If 'n' is negative or omitted, read all data until EOF is reached.
docstr_tok: ["Read","at","most","'n","'","bytes","from","the","buffer",",","or","less","if","the","read","hits","EOF","before","obtaining","'n","'","bytes",".","If","'n","'","is","negative","or","omitted",",","read","all","data","until","EOF","is","reached","."]
code: def read(self, n=-1):
      """Read at most 'n' bytes from the buffer, or less if the read
      hits EOF before obtaining 'n' bytes.
      If 'n' is negative or omitted, read all data until EOF is reached.
      """
      if self.closed:
          raise ValueError("I/O operation on closed file")
      if n is None or n < 0:
          newpos = self.len
      else:
          newpos = min(self.pos + n, self.len)
      r = self.buf[self.pos : newpos]
      self.pos = newpos
      return r
  
imports: from fontTools.misc.textTools import bytechr, byteord, bytesjoin, tobytes, tostr
  from fontTools.misc import eexec
  from .psOperators import PSOperators, ps_StandardEncoding, ps_array, ps_boolean, ps_dict, ps_integer, ps_literal, ps_mark, ps_name, ps_operator, ps_procedure, ps_procmark, ps_real, ps_string
  import re
  from collections.abc import Callable
  from string import whitespace
  import logging
label_desc: Use image node_id 2 for calling the PSTokenizer obj's underlying member method code with example usage: obj.read(n) and returns: r