class PDF::Reader::Parser

def hex_string

Reads a PDF hex string from the buffer and converts it to a Ruby String
###############################################################################
def hex_string
  str = "".dup
  loop do
    token = @buffer.token
    break if token == ">"
    raise MalformedPDFError, "unterminated hex string" if @buffer.empty?
    str << token
  end
  # add a missing digit if required, as required by the spec
  str << "0" unless str.size % 2 == 0
  [str].pack('H*')
end