class PDF::Reader::Buffer

def token

return the next token from the underlying IO stream
###############################################################################
def token
  ready_token
  
  i = @buffer.index(/[\[\]()<>{}\s\/]/) || @buffer.size
  token_chars = 
    if i == 0 and @buffer[i,2] == "<<"    then 2
    elsif i == 0 and @buffer[i,2] == ">>" then 2
    elsif i == 0                          then 1
    else                                    i
    end
  strip_space = !(i == 0 and @buffer[0,1] == '(')
  head(token_chars, strip_space)
end