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

Class Encoder

source code


Encodes an AMF3 data stream.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
buildContext(self)
A context factory.
source code
 
getTypeFunc(self, data)
Returns a callable that will encode data to self.stream.
source code
 
writeUndefined(self, n)
Writes an pyamf.Undefined value to the stream.
source code
 
writeNull(self, n)
Writes a null value to the stream.
source code
 
writeBoolean(self, n)
Writes a Boolean to the stream.
source code
 
_writeInteger(self, n)
AMF3 integers are encoded.
source code
 
writeInteger(self, n)
Writes an integer to the stream.
source code
 
writeNumber(self, n)
Writes a float to the stream.
source code
 
serialiseBytes(self, b) source code
 
serialiseString(self, s)
Writes a raw string to the stream.
source code
 
writeBytes(self, b)
Writes a raw string to the stream.
source code
 
writeString(self, s)
Writes a string to the stream.
source code
 
writeDate(self, n)
Writes a datetime instance to the stream.
source code
 
writeList(self, n, is_proxy=False)
Writes a tuple, set or list to the stream.
source code
 
writeDict(self, n)
Writes a dict to the stream.
source code
 
writeProxy(self, obj)
Encodes a proxied object to the stream.
source code
 
writeObject(self, obj, is_proxy=False)
Writes an object to the stream.
source code
 
writeByteArray(self, n)
Writes a ByteArray to the data stream.
source code
 
writeXML(self, n)
Writes a XML string to the data stream.
source code

Inherited from codec.Encoder: __iter__, next, send, writeElement, writeGenerator, writeSequence

Inherited from codec.Encoder (private): _write_type

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]

Inherited from codec._Codec: context, 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 help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

buildContext(self)

source code 

A context factory.

Overrides: codec._Codec.buildContext
(inherited documentation)

getTypeFunc(self, data)

source code 

Returns a callable that will encode data to self.stream. If data is unencodable, then None is returned.

Overrides: codec._Codec.getTypeFunc

writeUndefined(self, n)

source code 

Writes an pyamf.Undefined value to the stream.

Overrides: codec.Encoder._write_type

writeNull(self, n)

source code 

Writes a null value to the stream.

Overrides: codec.Encoder._write_type

writeBoolean(self, n)

source code 

Writes a Boolean to the stream.

Overrides: codec.Encoder._write_type

_writeInteger(self, n)

source code 

AMF3 integers are encoded.

Parameters:
  • n (integer data) - The integer data to be encoded to the AMF3 data stream.

See Also: Parsing Integers on OSFlash for more info.

writeInteger(self, n)

source code 

Writes an integer to the stream.

Parameters:
  • n (integer data) - The integer data to be encoded to the AMF3 data stream.

writeNumber(self, n)

source code 

Writes a float to the stream.

Parameters:
  • n (float)
Overrides: codec.Encoder._write_type

serialiseString(self, s)

source code 

Writes a raw string to the stream.

Parameters:
  • s (str) - The string data to be encoded to the AMF3 data stream.

writeBytes(self, b)

source code 

Writes a raw string to the stream.

Overrides: codec.Encoder._write_type

writeString(self, s)

source code 

Writes a string to the stream. It will be UTF-8 encoded.

Overrides: codec.Encoder._write_type

writeDate(self, n)

source code 

Writes a datetime instance to the stream.

Parameters:
  • n (datetime) - The Date data to be encoded to the AMF3 data stream.
Overrides: codec.Encoder._write_type

writeList(self, n, is_proxy=False)

source code 

Writes a tuple, set or list to the stream.

Parameters:
  • n (One of __builtin__.tuple, __builtin__.set or __builtin__.list) - The list data to be encoded to the AMF3 data stream.
Overrides: codec.Encoder._write_type

writeDict(self, n)

source code 

Writes a dict to the stream.

Parameters:
  • n (__builtin__.dict) - The dict data to be encoded to the AMF3 data stream.
Raises:
  • ValueError - Non int/str key value found in the dict
  • EncodeError - dict contains empty string keys.

writeProxy(self, obj)

source code 

Encodes a proxied object to the stream.

Since: 0.6

writeObject(self, obj, is_proxy=False)

source code 

Writes an object to the stream.

Overrides: codec.Encoder._write_type

writeByteArray(self, n)

source code 

Writes a ByteArray to the data stream.

Parameters:

writeXML(self, n)

source code 

Writes a XML string to the data stream.

Parameters:
  • n (ET) - The XML Document to be encoded to the AMF3 data stream.
Overrides: codec.Encoder._write_type