Package org.red5.io.amf3
Class DataInput
java.lang.Object
org.red5.io.amf3.DataInput
- All Implemented Interfaces:
IDataInput
Implementation of the IDataInput interface. Can be used to load an IExternalizable object.
- Author:
- The Red5 Project, Joachim Bauch (jojo@struktur.de)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the byteorder used when loading values.boolean
Read boolean value.byte
readByte()
Read signed single byte value.void
readBytes
(byte[] bytes) Read list of bytes.void
readBytes
(byte[] bytes, int offset) Read list of bytes to given offset.void
readBytes
(byte[] bytes, int offset, int length) Read given number of bytes to given offset.double
Read double-precision floating point value.float
Read single-precision floating point value.int
readInt()
Read signed integer value.readMultiByte
(int length, String charSet) Read multibyte string.Read arbitrary object.short
Read signed short value.int
Read unsigned single byte value.long
Read unsigned integer value.int
Read unsigned short value.readUTF()
Read UTF-8 encoded string.readUTFBytes
(int length) Read UTF-8 encoded string with given length.void
Set the byteorder to use when loading values.
-
Field Details
-
input
The input stream. -
buffer
private org.apache.mina.core.buffer.IoBuffer bufferRaw data of input source.
-
-
Constructor Details
-
DataInput
Create a new DataInput.- Parameters:
input
- input to use
-
-
Method Details
-
getEndian
Return the byteorder used when loading values.- Specified by:
getEndian
in interfaceIDataInput
- Returns:
- the byteorder
-
setEndian
Set the byteorder to use when loading values.- Specified by:
setEndian
in interfaceIDataInput
- Parameters:
endian
- the byteorder to use
-
readBoolean
public boolean readBoolean()Read boolean value.- Specified by:
readBoolean
in interfaceIDataInput
- Returns:
- the value
-
readByte
public byte readByte()Read signed single byte value.- Specified by:
readByte
in interfaceIDataInput
- Returns:
- the value
-
readBytes
public void readBytes(byte[] bytes) Read list of bytes.- Specified by:
readBytes
in interfaceIDataInput
- Parameters:
bytes
- destination for read bytes
-
readBytes
public void readBytes(byte[] bytes, int offset) Read list of bytes to given offset.- Specified by:
readBytes
in interfaceIDataInput
- Parameters:
bytes
- destination for read bytesoffset
- offset in destination to write to
-
readBytes
public void readBytes(byte[] bytes, int offset, int length) Read given number of bytes to given offset.- Specified by:
readBytes
in interfaceIDataInput
- Parameters:
bytes
- destination for read bytesoffset
- offset in destination to write tolength
- number of bytes to read
-
readDouble
public double readDouble()Read double-precision floating point value.- Specified by:
readDouble
in interfaceIDataInput
- Returns:
- the value
-
readFloat
public float readFloat()Read single-precision floating point value.- Specified by:
readFloat
in interfaceIDataInput
- Returns:
- the value
-
readInt
public int readInt()Read signed integer value.- Specified by:
readInt
in interfaceIDataInput
- Returns:
- the value
-
readMultiByte
Read multibyte string.- Specified by:
readMultiByte
in interfaceIDataInput
- Parameters:
length
- length of string to readcharSet
- character set of string to read- Returns:
- the string
-
readObject
Read arbitrary object.- Specified by:
readObject
in interfaceIDataInput
- Returns:
- the object
-
readShort
public short readShort()Read signed short value.- Specified by:
readShort
in interfaceIDataInput
- Returns:
- the value
-
readUnsignedByte
public int readUnsignedByte()Read unsigned single byte value.- Specified by:
readUnsignedByte
in interfaceIDataInput
- Returns:
- the value
-
readUnsignedInt
public long readUnsignedInt()Read unsigned integer value.- Specified by:
readUnsignedInt
in interfaceIDataInput
- Returns:
- the value
-
readUnsignedShort
public int readUnsignedShort()Read unsigned short value.- Specified by:
readUnsignedShort
in interfaceIDataInput
- Returns:
- the value
-
readUTF
Read UTF-8 encoded string.- Specified by:
readUTF
in interfaceIDataInput
- Returns:
- the string
-
readUTFBytes
Read UTF-8 encoded string with given length.- Specified by:
readUTFBytes
in interfaceIDataInput
- Parameters:
length
- the length of the string- Returns:
- the string
-