|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.io.amf3.ByteArray
public class ByteArray
Red5 version of the Flex ByteArray class.
Field Summary | |
---|---|
protected IoBuffer |
data
Internal storage for array contents. |
protected IDataInput |
dataInput
Object used to read from array. |
protected IDataOutput |
dataOutput
Object used to write to array. |
Constructor Summary | |
---|---|
|
ByteArray()
Public constructor. |
protected |
ByteArray(IoBuffer buffer,
int length)
Internal constructor used to create ByteArray during deserialization. |
Method Summary | |
---|---|
int |
bytesAvailable()
Return number of bytes available for reading. |
void |
compress()
Compress contents using zlib. |
boolean |
equals(Object obj)
|
protected IoBuffer |
getData()
Get internal data. |
ByteOrder |
getEndian()
Return the byteorder used when loading values. |
int |
hashCode()
|
int |
length()
Return total number of bytes in array. |
int |
position()
Get the current position in the data. |
void |
position(int position)
Set the current position in the data. |
protected void |
prepareIO()
Create internal objects used for reading and writing. |
boolean |
readBoolean()
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 |
readDouble()
Read double-precision floating point value. |
float |
readFloat()
Read single-precision floating point value. |
int |
readInt()
Read signed integer value. |
String |
readMultiByte(int length,
String charSet)
Read multibyte string. |
Object |
readObject()
Read arbitrary object. |
short |
readShort()
Read signed short value. |
int |
readUnsignedByte()
Read unsigned single byte value. |
long |
readUnsignedInt()
Read unsigned integer value. |
int |
readUnsignedShort()
Read unsigned short value. |
String |
readUTF()
Read UTF-8 encoded string. |
String |
readUTFBytes(int length)
Read UTF-8 encoded string with given length. |
void |
setEndian(ByteOrder endian)
Set the byteorder to use when loading values. |
String |
toString()
Return string representation of the array's contents. |
void |
uncompress()
Decompress contents using zlib. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IoBuffer data
protected IDataInput dataInput
protected IDataOutput dataOutput
Constructor Detail |
---|
protected ByteArray(IoBuffer buffer, int length)
buffer
- length
- public ByteArray()
Method Detail |
---|
protected void prepareIO()
protected IoBuffer getData()
public int position()
public void position(int position)
position
- position to setpublic int bytesAvailable()
public int length()
public void compress()
public void uncompress()
public ByteOrder getEndian()
getEndian
in interface IDataInput
getEndian
in interface IDataOutput
public boolean readBoolean()
readBoolean
in interface IDataInput
public byte readByte()
readByte
in interface IDataInput
public void readBytes(byte[] bytes)
readBytes
in interface IDataInput
bytes
- destination for read bytespublic void readBytes(byte[] bytes, int offset)
readBytes
in interface IDataInput
bytes
- destination for read bytesoffset
- offset in destination to write topublic void readBytes(byte[] bytes, int offset, int length)
readBytes
in interface IDataInput
bytes
- destination for read bytesoffset
- offset in destination to write tolength
- number of bytes to readpublic double readDouble()
readDouble
in interface IDataInput
public float readFloat()
readFloat
in interface IDataInput
public int readInt()
readInt
in interface IDataInput
public String readMultiByte(int length, String charSet)
readMultiByte
in interface IDataInput
length
- length of string to readcharSet
- character set of string to read
public Object readObject()
readObject
in interface IDataInput
public short readShort()
readShort
in interface IDataInput
public String readUTF()
readUTF
in interface IDataInput
public String readUTFBytes(int length)
readUTFBytes
in interface IDataInput
length
- the length of the string
public int readUnsignedByte()
readUnsignedByte
in interface IDataInput
public long readUnsignedInt()
readUnsignedInt
in interface IDataInput
public int readUnsignedShort()
readUnsignedShort
in interface IDataInput
public void setEndian(ByteOrder endian)
setEndian
in interface IDataInput
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 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 stringpublic void writeUnsignedInt(long value)
writeUnsignedInt
in interface IDataOutput
value
- the valuepublic int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |