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

Class DataOutput

source code


I am a StringIO type object containing byte data from the AMF stream. ActionScript 3.0 introduced the flash.utils.ByteArray class to support the manipulation of raw data in the form of an Array of bytes. I provide a set of methods for writing binary data with ActionScript 3.0.

This class is the I/O counterpart to the DataInput class, which reads binary data.


See Also: IDataOutput on Livedocs (external)

Instance Methods [hide private]
 
__init__(self, encoder)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
writeBoolean(self, value)
Writes a Boolean value.
source code
 
writeByte(self, value)
Writes a byte.
source code
 
writeUnsignedByte(self, value)
Writes an unsigned byte.
source code
 
writeDouble(self, value)
Writes an IEEE 754 double-precision (64-bit) floating point number.
source code
 
writeFloat(self, value)
Writes an IEEE 754 single-precision (32-bit) floating point number.
source code
 
writeInt(self, value)
Writes a 32-bit signed integer.
source code
 
writeMultiByte(self, value, charset)
Writes a multibyte string to the datastream using the specified character set.
source code
 
writeObject(self, value)
Writes an object to data stream in AMF serialized format.
source code
 
writeShort(self, value)
Writes a 16-bit integer.
source code
 
writeUnsignedShort(self, value)
Writes a 16-bit unsigned integer.
source code
 
writeUnsignedInt(self, value)
Writes a 32-bit unsigned integer.
source code
 
writeUTF(self, value)
Writes a UTF-8 string to the data stream.
source code
 
writeUTFBytes(self, value)
Writes a UTF-8 string.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, encoder)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
Overrides: object.__init__

writeBoolean(self, value)

source code 

Writes a Boolean value.

Parameters:
  • value (bool) - A Boolean value determining which byte is written. If the parameter is True, 1 is written; if False, 0 is written.
Raises:
  • ValueError - Non-boolean value found.

writeByte(self, value)

source code 

Writes a byte.

Parameters:
  • value (int)

writeUnsignedByte(self, value)

source code 

Writes an unsigned byte.

Parameters:
  • value (int)

Since: 0.5

writeDouble(self, value)

source code 

Writes an IEEE 754 double-precision (64-bit) floating point number.

Parameters:
  • value (number)

writeFloat(self, value)

source code 

Writes an IEEE 754 single-precision (32-bit) floating point number.

Parameters:
  • value (float)

writeInt(self, value)

source code 

Writes a 32-bit signed integer.

Parameters:
  • value (int)

writeMultiByte(self, value, charset)

source code 

Writes a multibyte string to the datastream using the specified character set.

Parameters:
  • value (str) - The string value to be written.
  • charset (str) - The string denoting the character set to use. Possible character set strings include shift-jis, cn-gb, iso-8859-1 and others.

writeObject(self, value)

source code 

Writes an object to data stream in AMF serialized format.

Parameters:
  • value - The object to be serialized.

writeShort(self, value)

source code 

Writes a 16-bit integer.

Parameters:
  • value (int) - A byte value as an integer.

writeUnsignedShort(self, value)

source code 

Writes a 16-bit unsigned integer.

Parameters:
  • value (int) - A byte value as an integer.

Since: 0.5

writeUnsignedInt(self, value)

source code 

Writes a 32-bit unsigned integer.

Parameters:
  • value (int) - A byte value as an unsigned integer.

writeUTF(self, value)

source code 

Writes a UTF-8 string to the data stream.

The length of the UTF-8 string in bytes is written first, as a 16-bit integer, followed by the bytes representing the characters of the string.

Parameters:
  • value (str) - The string value to be written.

writeUTFBytes(self, value)

source code 

Writes a UTF-8 string. Similar to writeUTF, but does not prefix the string with a 16-bit length word.

Parameters:
  • value (str) - The string value to be written.