|
||||||||||
| 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. |
protected IoBuffer |
getData()
Get internal data. |
ByteOrder |
getEndian()
Return the byteorder used when loading values. |
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, equals, finalize, getClass, hashCode, 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 String toString()
toString in class Objectpublic void compress()
public void uncompress()
public ByteOrder getEndian()
getEndian in interface IDataInputgetEndian in interface IDataOutputpublic boolean readBoolean()
readBoolean in interface IDataInputpublic byte readByte()
readByte in interface IDataInputpublic void readBytes(byte[] bytes)
readBytes in interface IDataInputbytes - destination for read bytes
public void readBytes(byte[] bytes,
int offset)
readBytes in interface IDataInputbytes - destination for read bytesoffset - offset in destination to write to
public void readBytes(byte[] bytes,
int offset,
int length)
readBytes in interface IDataInputbytes - destination for read bytesoffset - offset in destination to write tolength - number of bytes to readpublic double readDouble()
readDouble in interface IDataInputpublic float readFloat()
readFloat in interface IDataInputpublic int readInt()
readInt in interface IDataInput
public String readMultiByte(int length,
String charSet)
readMultiByte in interface IDataInputlength - length of string to readcharSet - character set of string to read
public Object readObject()
readObject in interface IDataInputpublic short readShort()
readShort in interface IDataInputpublic String readUTF()
readUTF in interface IDataInputpublic String readUTFBytes(int length)
readUTFBytes in interface IDataInputlength - the length of the string
public int readUnsignedByte()
readUnsignedByte in interface IDataInputpublic long readUnsignedInt()
readUnsignedInt in interface IDataInputpublic int readUnsignedShort()
readUnsignedShort in interface IDataInputpublic void setEndian(ByteOrder endian)
setEndian in interface IDataInputsetEndian in interface IDataOutputendian - the byteorder to usepublic void writeBoolean(boolean value)
writeBoolean in interface IDataOutputvalue - the valuepublic void writeByte(byte value)
writeByte in interface IDataOutputvalue - the valuepublic void writeBytes(byte[] bytes)
writeBytes in interface IDataOutputbytes - the bytes
public void writeBytes(byte[] bytes,
int offset)
writeBytes in interface IDataOutputbytes - the bytesoffset - offset in bytes to start writing from
public void writeBytes(byte[] bytes,
int offset,
int length)
writeBytes in interface IDataOutputbytes - the bytesoffset - offset in bytes to start writing fromlength - number of bytes to writepublic void writeDouble(double value)
writeDouble in interface IDataOutputvalue - the valuepublic void writeFloat(float value)
writeFloat in interface IDataOutputvalue - the valuepublic void writeInt(int value)
writeInt in interface IDataOutputvalue - the value
public void writeMultiByte(String value,
String encoding)
writeMultiByte in interface IDataOutputvalue - the stringencoding - the character setpublic void writeObject(Object value)
writeObject in interface IDataOutputvalue - the objectpublic void writeShort(short value)
writeShort in interface IDataOutputvalue - the valuepublic void writeUTF(String value)
writeUTF in interface IDataOutputvalue - the stringpublic void writeUTFBytes(String value)
IDataInput.readUTFBytes(int) must be used to load it.
writeUTFBytes in interface IDataOutputvalue - the stringpublic void writeUnsignedInt(long value)
writeUnsignedInt in interface IDataOutputvalue - the value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||