Package org.red5.io.amf3
Class DataOutput
- java.lang.Object
-
- org.red5.io.amf3.DataOutput
-
- All Implemented Interfaces:
IDataOutput
public class DataOutput extends Object implements IDataOutput
Implementation of the IDataOutput interface. Can be used to store an IExternalizable object.- Author:
- The Red5 Project, Joachim Bauch (jojo@struktur.de)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDataOutput(Output output)Create a new DataOutput.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteOrdergetEndian()Return the byteorder used when storing values.voidsetEndian(ByteOrder endian)Set the byteorder to use when storing values.voidwriteBoolean(boolean value)Write boolean value.voidwriteByte(byte value)Write signed byte value.voidwriteBytes(byte[] bytes)Write multiple bytes.voidwriteBytes(byte[] bytes, int offset)Write multiple bytes from given offset.voidwriteBytes(byte[] bytes, int offset, int length)Write given number of bytes from given offset.voidwriteDouble(double value)Write double-precision floating point value.voidwriteFloat(float value)Write single-precision floating point value.voidwriteInt(int value)Write signed integer value.voidwriteMultiByte(String value, String encoding)Write string in given character set.voidwriteObject(Object value)Write arbitrary object.voidwriteShort(short value)Write signed short value.voidwriteUnsignedInt(long value)Write unsigned integer value.voidwriteUTF(String value)Write UTF-8 encoded string.voidwriteUTFBytes(String value)Write UTF-8 encoded string as byte array.
-
-
-
Constructor Detail
-
DataOutput
protected DataOutput(Output output)
Create a new DataOutput.- Parameters:
output- destination to write to
-
-
Method Detail
-
getEndian
public ByteOrder getEndian()
Return the byteorder used when storing values.- Specified by:
getEndianin interfaceIDataOutput- Returns:
- the byteorder
-
setEndian
public void setEndian(ByteOrder endian)
Set the byteorder to use when storing values.- Specified by:
setEndianin interfaceIDataOutput- Parameters:
endian- the byteorder to use
-
writeBoolean
public void writeBoolean(boolean value)
Write boolean value.- Specified by:
writeBooleanin interfaceIDataOutput- Parameters:
value- the value
-
writeByte
public void writeByte(byte value)
Write signed byte value.- Specified by:
writeBytein interfaceIDataOutput- Parameters:
value- the value
-
writeBytes
public void writeBytes(byte[] bytes)
Write multiple bytes.- Specified by:
writeBytesin interfaceIDataOutput- Parameters:
bytes- the bytes
-
writeBytes
public void writeBytes(byte[] bytes, int offset)Write multiple bytes from given offset.- Specified by:
writeBytesin interfaceIDataOutput- Parameters:
bytes- the bytesoffset- offset in bytes to start writing from
-
writeBytes
public void writeBytes(byte[] bytes, int offset, int length)Write given number of bytes from given offset.- Specified by:
writeBytesin interfaceIDataOutput- Parameters:
bytes- the bytesoffset- offset in bytes to start writing fromlength- number of bytes to write
-
writeDouble
public void writeDouble(double value)
Write double-precision floating point value.- Specified by:
writeDoublein interfaceIDataOutput- Parameters:
value- the value
-
writeFloat
public void writeFloat(float value)
Write single-precision floating point value.- Specified by:
writeFloatin interfaceIDataOutput- Parameters:
value- the value
-
writeInt
public void writeInt(int value)
Write signed integer value.- Specified by:
writeIntin interfaceIDataOutput- Parameters:
value- the value
-
writeMultiByte
public void writeMultiByte(String value, String encoding)
Write string in given character set.- Specified by:
writeMultiBytein interfaceIDataOutput- Parameters:
value- the stringencoding- the character set
-
writeObject
public void writeObject(Object value)
Write arbitrary object.- Specified by:
writeObjectin interfaceIDataOutput- Parameters:
value- the object
-
writeShort
public void writeShort(short value)
Write signed short value.- Specified by:
writeShortin interfaceIDataOutput- Parameters:
value- the value
-
writeUnsignedInt
public void writeUnsignedInt(long value)
Write unsigned integer value.- Specified by:
writeUnsignedIntin interfaceIDataOutput- Parameters:
value- the value
-
writeUTF
public void writeUTF(String value)
Write UTF-8 encoded string.- Specified by:
writeUTFin interfaceIDataOutput- Parameters:
value- the string
-
writeUTFBytes
public void writeUTFBytes(String value)
Write UTF-8 encoded string as byte array. This string is stored without informations about its length, soIDataInput.readUTFBytes(int)must be used to load it.- Specified by:
writeUTFBytesin interfaceIDataOutput- Parameters:
value- the string
-
-