class PDF::Reader::Error

def self.str_assert(lvalue, rvalue, chars=nil)

###############################################################################
:nodoc:
are valid
An internal PDF::Reader class that helps to verify various parts of the PDF file
###############################################################################
def self.str_assert(lvalue, rvalue, chars=nil)
  raise MalformedPDFError, "PDF malformed, expected string but found #{lvalue.class} instead" if chars and !lvalue.kind_of?(String)
  lvalue = lvalue[0,chars] if chars
  raise MalformedPDFError, "PDF malformed, expected '#{rvalue}' but found #{lvalue} instead"  if lvalue != rvalue
end