Package pyamf :: Module amf3

[hide private]
[frames] | no frames]

# Module amf3

source code

AMF3 implementation.

`AMF3` is the default serialization for ActionScript 3.0 and provides various advantages over AMF0, which is used for ActionScript 1.0 and 2.0. It adds support for sending `int` and `uint` objects as integers and supports data types that are available only in ActionScript 3.0, such as ByteArray and ArrayCollection.

See Also:
  Official AMF3 Specification in English (external), Official AMF3 Specification in Japanese (external), AMF3 documentation on OSFlash (external)

Since: 0.1.0

Classes | [hide private]

| ASTypes All AMF3 data types used in ActionScript 3.0.
| ObjectEncoding AMF object encodings.
| DataOutput I am a `StringIO` type object containing byte data from the AMF stream.
| DataInput I provide a set of methods for reading binary data with ActionScript 3.0.
| ByteArray I am a `StringIO` type object containing byte data from the AMF stream.
| ClassDefinition I contain meta relating to the class definition.
| Context I hold the AMF3 context for en/decoding streams.
| Decoder Decodes an AMF3 data stream.
| Encoder Encodes an AMF3 data stream.

Functions | [hide private]

decode(stream, context=None, strict=False) A helper function to decode an AMF3 datastream. | source code

BufferedByteStream

encode(*args, **kwargs) A helper function to encode an element into AMF3 format. | source code

_encode_int(n) | source code

_decode_int(stream, signed=False) | source code

Variables | [hide private]

| use_proxies_default = `False` If True encode/decode lists/tuples to ArrayCollections and dicts to ObjectProxy
| ACTIONSCRIPT_TYPES = ``[`7`,` 12`,` 0`,` 2`,` 10`,` 5`,` 3`,` 8`,` 4`,` 9`,` 1`,` 11`,` 6`]`` List of available ActionScript types in AMF3.
| REFERENCE_BIT = `1` Reference bit.

Imports: types, datetime, zlib, pyamf, util, ObjectProxy, ArrayCollection, set, encode_int, decode_int

Function Details | [hide private]

### decode(stream, context=None, strict=False)

source code

A helper function to decode an AMF3 datastream.

Parameters:
  - `stream` (BufferedByteStream) - AMF3 data.
  - `context` (Context) - Context.

### encode(*args, **kwargs)

source code

A helper function to encode an element into AMF3 format.

Parameters:
  - `context` (Context) - Any initial context to use.
  - `args` (List of args to encode.)
Returns: BufferedByteStream
  `StringIO` type object containing the encoded AMF3 data.

### _encode_int(n)

source code

Raises:
  - `OverflowError` - Out of range.