Package org.red5.io.amf3
Class DataInput
- java.lang.Object
-
- org.red5.io.amf3.DataInput
-
- All Implemented Interfaces:
IDataInput
public class DataInput extends Object implements IDataInput
Implementation of the IDataInput interface. Can be used to load an IExternalizable object.- Author:
- The Red5 Project, Joachim Bauch (jojo@struktur.de)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteOrdergetEndian()Return the byteorder used when loading values.booleanreadBoolean()Read 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.doublereadDouble()Read double-precision floating point value.floatreadFloat()Read single-precision floating point value.intreadInt()Read signed integer value.StringreadMultiByte(int length, String charSet)Read multibyte string.ObjectreadObject()Read arbitrary object.shortreadShort()Read signed short value.intreadUnsignedByte()Read unsigned single byte value.longreadUnsignedInt()Read unsigned integer value.intreadUnsignedShort()Read unsigned short value.StringreadUTF()Read UTF-8 encoded string.StringreadUTFBytes(int length)Read UTF-8 encoded string with given length.voidsetEndian(ByteOrder endian)Set the byteorder to use when loading values.
-
-
-
Constructor Detail
-
DataInput
protected DataInput(Input input)
Create a new DataInput.- Parameters:
input- input to use
-
-
Method Detail
-
getEndian
public ByteOrder getEndian()
Return the byteorder used when loading values.- Specified by:
getEndianin interfaceIDataInput- Returns:
- the byteorder
-
setEndian
public void setEndian(ByteOrder endian)
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
public String readMultiByte(int length, String charSet)
Read multibyte string.- Specified by:
readMultiBytein interfaceIDataInput- Parameters:
length- length of string to readcharSet- character set of string to read- Returns:
- the string
-
readObject
public Object 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
public String readUTF()
Read UTF-8 encoded string.- Specified by:
readUTFin interfaceIDataInput- Returns:
- the string
-
readUTFBytes
public String readUTFBytes(int length)
Read UTF-8 encoded string with given length.- Specified by:
readUTFBytesin interfaceIDataInput- Parameters:
length- the length of the string- Returns:
- the string
-
-