def read_byte_array(input, context): amf.utils.logger().debug("amf3.read_byte_array()") ref = read_integer(input) inline = ref & 0x01 != 0 ref >>= 1 if inline: data = amf0.read_utf(input, context, ref) ba = amf.ByteArray(data) context.add_object_reference(ba) return ba else: return context.get_object_reference(ref)
def read_xml(input, context): amf.utils.logger().debug("amf3.read_xml()") ref = read_integer(input) inline = ref & 0x01 != 0 ref >>= 1 if inline: xmlStr = amf0.read_utf(input, context, ref) xml = minidom.parseString(xmlStr) context.add_object_reference(xml) else: xml = context.get_object_reference(ref) amf.utils.logger().debug("amf3.read_xml() -- result='%s'", xml.toxml()) return xml
def read_string(input, context): amf.utils.logger().debug("amf3.read_string()") ref = read_integer(input) inline = ref & 0x01 != 0 ref >>= 1 if inline: strlen = ref if strlen == 0: return '' str = amf0.read_utf(input, context, strlen) context.add_string_reference(str) else: str = context.get_string_reference(ref) amf.utils.logger().debug("amf3.read_string() -- result=%s", repr(str)) return str