Package pyamf :: Module amf3 :: Class Decoder |
[hide private]
[frames] | no frames]

# Class Decoder

source code

Decodes an AMF3 data stream.

Nested Classes | [hide private]
An instance of `BaseDecoder.context_class` | context_class The context for the decoding.

Instance Methods | [hide private]
__init__(self, *args, **kwargs) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
readUndefined(self) Read undefined. | source code
`None` |
readNull(self) Read null. | source code
`bool` |
readBoolFalse(self) Returns `False`. | source code
`bool` |
readBoolTrue(self) Returns `True`. | source code
readNumber(self) Read number. | source code
readUnsignedInteger(self) Reads and returns an unsigned integer from the stream. | source code
readSignedInteger(self) Reads and returns a signed integer from the stream. | source code
readInteger(self, signed=False) Reads and returns an integer from the stream. | source code
readString(self, use_references=True) Reads and returns a string from the stream. | source code
readDate(self) Read date from the stream. | source code
readArray(self) Reads an array from the stream. | source code
_getClassDefinition(self, ref) Reads class definition from the stream. | source code
readObject(self, use_proxies=None) Reads an object from the stream. | source code
readProxyObject(self, proxy) Return the source object of a proxied object. | source code
_readXML(self, legacy=False) Reads an object from the stream. | source code
ET |
readXMLString(self) Reads a string from the data stream and converts it into an XML Tree. | source code
ET |
readXML(self) Read a legacy XML Document from the stream. | source code
readByteArray(self) Reads a string of data from the stream. | source code
Inherited from `BaseDecoder`: `__iter__`, `readElement` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Class Variables | [hide private]
`list` | type_map = ``{``'``\x00``'``:` `'``readUndefined``'``,` `'``\x01``'``:` `'``readNull``'``,` `'``\x02``...``

Instance Variables | [hide private]
Inherited from `BaseDecoder`: `stream`, `strict`, `timezone_offset`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, *args, **kwargs) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Overrides: object.__init__ (inherited documentation)

### readNull(self) | source code
Read null. Returns: `None` `None`

### readBoolFalse(self) | source code
Returns `False`. Returns: `bool` `False`

### readBoolTrue(self) | source code
Returns `True`. Returns: `bool` `True`

### readInteger(self, signed=False) | source code
Reads and returns an integer from the stream. Parameters: `signed` (`bool`) See Also: Parsing integers on OSFlash for the AMF3 integer data format.

### readString(self, use_references=True) | source code
Reads and returns a string from the stream. Parameters: `use_references` (`bool`)

### readDate(self) | source code
Read date from the stream. The timezone is ignored as the date is always in UTC.

### readArray(self) | source code
Reads an array from the stream. Warning: There is a very specific problem with AMF3 where the first three bytes of an encoded empty `dict` will mirror that of an encoded `{'': 1, '2': 2}` See Also: Docuverse blog (external)

### readObject(self, use_proxies=None) | source code
Reads an object from the stream. Raises: `pyamf.EncodeError` - Decoding an object in amf3 tagged as amf0 only is not allowed. `pyamf.DecodeError` - Unknown object encoding.

### readProxyObject(self, proxy) | source code
Return the source object of a proxied object. Since: 0.4

### _readXML(self, legacy=False) | source code
Reads an object from the stream. Parameters: `legacy` (`bool`) - The read XML is in 'legacy' format.

### readXMLString(self) | source code
Reads a string from the data stream and converts it into an XML Tree. Returns: ET The XML Document.

### readXML(self) | source code
Read a legacy XML Document from the stream. Returns: ET The XML Document.

### readByteArray(self) | source code
Reads a string of data from the stream. Detects if the ByteArray was compressed using `zlib`. See Also: ByteArray Note: This is not supported in ActionScript 1.0 and 2.0.

Class Variable Details | [hide private]

  ### type_map Type: `list` Value:
      {'\x00': 'readUndefined',
       '\x01': 'readNull',
       '\x02': 'readBoolFalse',
       '\x03': 'readBoolTrue',
       '\x04': 'readSignedInteger',
       '\x05': 'readNumber',
       '\x06': 'readString',
       '\x07': 'readXML',
      ...