class PDF::Reader::Parser

def object(id, gen)

gen - the object revision number to return
id - the object ID to return

that describes it
If the object is a content stream, returns both the stream and the dictionary
Reads an entire PDF object from the buffer and returns it as a Ruby String.
###############################################################################
def object(id, gen)
  idCheck = parse_token
  # Sometimes the xref table is corrupt and points to an offset slightly too early in the file.
  # check the next token, maybe we can find the start of the object we're looking for
  if idCheck != id
    Error.assert_equal(parse_token, id)
  end
  Error.assert_equal(parse_token, gen)
  Error.str_assert(parse_token, "obj")
  obj = parse_token
  post_obj = parse_token
  if obj.is_a?(Hash) && post_obj == "stream"
    stream(obj)
  else
    obj
  end
end