public class DataOutput extends Object implements IDataOutput
Modifier | Constructor and Description |
---|---|
protected |
DataOutput(Output output,
Serializer serializer)
Create a new DataOutput.
|
Modifier and Type | Method and Description |
---|---|
ByteOrder |
getEndian()
Return the byteorder used when storing values.
|
void |
setEndian(ByteOrder endian)
Set the byteorder to use when storing values.
|
void |
writeBoolean(boolean value)
Write boolean value.
|
void |
writeByte(byte value)
Write signed byte value.
|
void |
writeBytes(byte[] bytes)
Write multiple bytes.
|
void |
writeBytes(byte[] bytes,
int offset)
Write multiple bytes from given offset.
|
void |
writeBytes(byte[] bytes,
int offset,
int length)
Write given number of bytes from given offset.
|
void |
writeDouble(double value)
Write double-precision floating point value.
|
void |
writeFloat(float value)
Write single-precision floating point value.
|
void |
writeInt(int value)
Write signed integer value.
|
void |
writeMultiByte(String value,
String encoding)
Write string in given character set.
|
void |
writeObject(Object value)
Write arbitrary object.
|
void |
writeShort(short value)
Write signed short value.
|
void |
writeUnsignedInt(long value)
Write unsigned integer value.
|
void |
writeUTF(String value)
Write UTF-8 encoded string.
|
void |
writeUTFBytes(String value)
Write UTF-8 encoded string as byte array.
|
protected DataOutput(Output output, Serializer serializer)
output
- destination to write toserializer
- the serializer to usepublic ByteOrder getEndian()
getEndian
in interface IDataOutput
public void setEndian(ByteOrder endian)
setEndian
in interface IDataOutput
endian
- the byteorder to usepublic void writeBoolean(boolean value)
writeBoolean
in interface IDataOutput
value
- the valuepublic void writeByte(byte value)
writeByte
in interface IDataOutput
value
- the valuepublic void writeBytes(byte[] bytes)
writeBytes
in interface IDataOutput
bytes
- the bytespublic void writeBytes(byte[] bytes, int offset)
writeBytes
in interface IDataOutput
bytes
- the bytesoffset
- offset in bytes to start writing frompublic void writeBytes(byte[] bytes, int offset, int length)
writeBytes
in interface IDataOutput
bytes
- the bytesoffset
- offset in bytes to start writing fromlength
- number of bytes to writepublic void writeDouble(double value)
writeDouble
in interface IDataOutput
value
- the valuepublic void writeFloat(float value)
writeFloat
in interface IDataOutput
value
- the valuepublic void writeInt(int value)
writeInt
in interface IDataOutput
value
- the valuepublic void writeMultiByte(String value, String encoding)
writeMultiByte
in interface IDataOutput
value
- the stringencoding
- the character setpublic void writeObject(Object value)
writeObject
in interface IDataOutput
value
- the objectpublic void writeShort(short value)
writeShort
in interface IDataOutput
value
- the valuepublic void writeUnsignedInt(long value)
writeUnsignedInt
in interface IDataOutput
value
- the valuepublic void writeUTF(String value)
writeUTF
in interface IDataOutput
value
- the stringpublic void writeUTFBytes(String value)
IDataInput.readUTFBytes(int)
must be used to load it.writeUTFBytes
in interface IDataOutput
value
- the stringCopyright © 2006-2012 The Red5 Project