org.spicefactory.cinnamon.io
Interface DataOutput

All Known Implementing Classes:
AMFOutput

public interface DataOutput

Interface providing methods for writing binary data. This interface corresponds to the flash.utils.IDataOutput interface of the core Flash Player API. Binary data is written in big-endian format.

Author:
Jens Halm

Method Summary
 void writeBoolean(boolean value)
          Writes a boolean value as a single byte.
 void writeByte(byte value)
          Writes a single byte.
 void writeBytes(byte[] buffer, int offset, int length)
          Writes the number of bytes specified by the length parameter from the given byte buffer starting at the specified offset.
 void writeDouble(double value)
          Writes a double value.
 void writeFloat(float value)
          Writes a float value.
 void writeInt(int value)
          Writes an int value.
 void writeMultiByte(String value, String charset)
          Writes a multibyte string using the given character set.
 void writeObject(Object value)
          Encodes and writes an object in AMF3 binary format.
 void writeShort(short value)
          Writes a short value.
 void writeUnsignedInt(long value)
          Writes an unsigned int.
 void writeUTF(String value)
          Writes a UTF-8 string prepended by a short value representing the length of the string in bytes.
 void writeUTFBytes(String value)
          Writes a UTF-8 string.
 

Method Detail

writeBoolean

void writeBoolean(boolean value)
Writes a boolean value as a single byte. Writes 1 if the value is true, 0 otherwise.

Parameters:
value - the boolean value to write

writeByte

void writeByte(byte value)
Writes a single byte.

Parameters:
value - the byte value to write

writeBytes

void writeBytes(byte[] buffer,
                int offset,
                int length)
Writes the number of bytes specified by the length parameter from the given byte buffer starting at the specified offset.

Parameters:
buffer - the data to write
offset - the offset into the data
length - the number of bytes to write

writeDouble

void writeDouble(double value)
Writes a double value.

Parameters:
value - the double value to write

writeFloat

void writeFloat(float value)
Writes a float value.

Parameters:
value - the float value to write

writeShort

void writeShort(short value)
Writes a short value.

Parameters:
value - the short value to write

writeInt

void writeInt(int value)
Writes an int value.

Parameters:
value - the int value to write

writeUnsignedInt

void writeUnsignedInt(long value)
Writes an unsigned int. The specified long value must be in the range of a 32bit unsigned integer.

Parameters:
value -

writeUTF

void writeUTF(String value)
Writes a UTF-8 string prepended by a short value representing the length of the string in bytes.

Parameters:
value -

writeUTFBytes

void writeUTFBytes(String value)
Writes a UTF-8 string.

Parameters:
value -

writeMultiByte

void writeMultiByte(String value,
                    String charset)
Writes a multibyte string using the given character set.

Parameters:
value - the string to write
charset - the character set to use to decode the bytes

writeObject

void writeObject(Object value)
Encodes and writes an object in AMF3 binary format.

Parameters:
value - the object to encode and write