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 ([email protected])
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the byteorder used when loading values.booleanRead boolean value.bytereadByte()Read signed single byte value.voidreadBytes(byte[] bytes) Read list of bytes.voidreadBytes(byte[] bytes, int offset) Read list of bytes to given offset.voidreadBytes(byte[] bytes, int offset, int length) Read given number of bytes to given offset.doubleRead double-precision floating point value.floatRead single-precision floating point value.intreadInt()Read signed integer value.readMultiByte(int length, String charSet) Read multibyte string.Read arbitrary object.shortRead signed short value.intRead unsigned single byte value.longRead unsigned integer value.intRead unsigned short value.readUTF()Read UTF-8 encoded string.readUTFBytes(int length) Read UTF-8 encoded string with given length.voidSet 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:
getEndianin interfaceIDataInput- Returns:
- the byteorder
-
setEndian
Set the byteorder to use when loading values.- Specified by:
setEndianin interfaceIDataInput- Parameters:
endian- the byteorder to use
-
readBoolean
public boolean readBoolean()Read boolean value.- Specified by:
readBooleanin interfaceIDataInput- Returns:
- the value
-
readByte
public byte readByte()Read signed single byte value.- Specified by:
readBytein interfaceIDataInput- Returns:
- the value
-
readBytes
public void readBytes(byte[] bytes) Read list of bytes.- Specified by:
readBytesin interfaceIDataInput- Parameters:
bytes- destination for read bytes
-
readBytes
public void readBytes(byte[] bytes, int offset) Read list of bytes to given offset.- Specified by:
readBytesin 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:
readBytesin 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:
readDoublein interfaceIDataInput- Returns:
- the value
-
readFloat
public float readFloat()Read single-precision floating point value.- Specified by:
readFloatin interfaceIDataInput- Returns:
- the value
-
readInt
public int readInt()Read signed integer value.- Specified by:
readIntin interfaceIDataInput- Returns:
- the value
-
readMultiByte
Read multibyte string.- Specified by:
readMultiBytein interfaceIDataInput- Parameters:
length- length of string to readcharSet- character set of string to read- Returns:
- the string
-
readObject
Read arbitrary object.- Specified by:
readObjectin interfaceIDataInput- Returns:
- the object
-
readShort
public short readShort()Read signed short value.- Specified by:
readShortin interfaceIDataInput- Returns:
- the value
-
readUnsignedByte
public int readUnsignedByte()Read unsigned single byte value.- Specified by:
readUnsignedBytein interfaceIDataInput- Returns:
- the value
-
readUnsignedInt
public long readUnsignedInt()Read unsigned integer value.- Specified by:
readUnsignedIntin interfaceIDataInput- Returns:
- the value
-
readUnsignedShort
public int readUnsignedShort()Read unsigned short value.- Specified by:
readUnsignedShortin interfaceIDataInput- Returns:
- the value
-
readUTF
Read UTF-8 encoded string.- Specified by:
readUTFin interfaceIDataInput- Returns:
- the string
-
readUTFBytes
Read UTF-8 encoded string with given length.- Specified by:
readUTFBytesin interfaceIDataInput- Parameters:
length- the length of the string- Returns:
- the string
-