|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.spicefactory.cinnamon.io.amf.AMFInput
public class AMFInput
The AMFInput class deserializes AMF data from a ByteBuffer and constructs and populates
an AMFEnvelope instance with the decoded messages. This implementation only supports AMF3 data.
The only method that should be called by application code is readEnvelope which does
all the deserialization work. Other methods will be invoked by collaborating objects like
class mapping and externalizer instances.
| Nested Class Summary | |
|---|---|
protected class |
AMFInput.ClassDescriptor
Represents a decoded class descriptor. |
| Constructor Summary | |
|---|---|
AMFInput(org.apache.mina.common.ByteBuffer buffer,
CinnamonConfig config)
Creates a new AMFInput instance. |
|
| Method Summary | |
|---|---|
protected void |
addClassDescriptor(AMFInput.ClassDescriptor desc)
Adds a decoded ClassDescriptor. |
protected int |
addObjectReference(Object obj)
Adds an object to the list of references. |
protected void |
addStringReference(String str)
Adds a string to the list of references. |
protected AMFInput.ClassDescriptor |
getClassDescriptor(int index)
Returns the class descriptor for the given index. |
protected Object |
getObjectReference(int index)
Returns the object reference for the given index. |
protected String |
getStringReference(int index)
Returns the string reference for the given index. |
protected List<Object> |
readAMFArray()
Reads an AMF3 Array and returns it as a List. |
protected byte[] |
readAMFByteArray()
Reads and returns an AMF3 byte array. |
protected Date |
readAMFDate()
Reads an AMF3 date value. |
int |
readAMFInt()
Reads an AMF3 int value. |
protected Object |
readAMFObject()
Reads an AMF3 object. |
String |
readAMFString()
Reads an AMF3 string value. |
protected Object |
readAMFXml()
Reads an XML string and returns it as a DOM instance. |
boolean |
readBoolean()
Reads a boolean value. |
byte |
readByte()
Reads and returns a single byte. |
void |
readBytes(byte[] bytearray,
int offset,
int length)
Reads the number of bytes specified by the length parameter into the given byte buffer starting at the specified offset. |
double |
readDouble()
Reads and returns a double. |
float |
readFloat()
Reads and returns a float. |
int |
readInt()
Reads and returns an int. |
String |
readMultiByte(int length,
String charset)
Reads a multibyte string of specified length using the given character set. |
Object |
readObject()
Reads, deserializes and returns an object encoded in AMF3 binary format. |
short |
readShort()
Reads and returns a short. |
protected String |
readString(Charset charset,
int length)
Decodes a String of the specified length with the given character set. |
long |
readUnsignedInt()
Reads and returns an unsigned int. |
int |
readUnsignedShort()
Reads and returns an unsigned short. |
String |
readUTF()
Reads and returns a UTF-8 String. |
String |
readUTFBytes(int length)
Reads the specified number of UTF-8 encoded bytes and returns the decoded string. |
void |
reset()
Resets all internal Collections of object references. |
protected void |
setObjectReference(int index,
Object obj)
Sets the object reference for the specified index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AMFInput(org.apache.mina.common.ByteBuffer buffer,
CinnamonConfig config)
buffer - the ByteBuffer to read AMF3 data fromconfig - the Cinnamon configuration instance| Method Detail |
|---|
public int readAMFInt()
public String readAMFString()
protected String readString(Charset charset,
int length)
charset - the character set to uselength - the length of the String in bytes
protected Date readAMFDate()
protected List<Object> readAMFArray()
protected Object readAMFObject()
public Object readObject()
DataInput
readObject in interface DataInputprotected Object readAMFXml()
protected byte[] readAMFByteArray()
public void reset()
protected void addStringReference(String str)
str - a string to add to the list of referencesprotected String getStringReference(int index)
index - the index of the string reference
protected int addObjectReference(Object obj)
obj - an object to add to the list of references
protected void setObjectReference(int index,
Object obj)
index - the index of the object referenceobj - the object referenceprotected Object getObjectReference(int index)
index - the index of the object reference
protected void addClassDescriptor(AMFInput.ClassDescriptor desc)
desc - the class descriptor to addprotected AMFInput.ClassDescriptor getClassDescriptor(int index)
index - the index of the class descriptor
public boolean readBoolean()
DataInput
readBoolean in interface DataInputpublic byte readByte()
DataInput
readByte in interface DataInput
public void readBytes(byte[] bytearray,
int offset,
int length)
DataInput
readBytes in interface DataInputbytearray - the buffer to read intooffset - the offset into the datalength - the number of bytes to readpublic double readDouble()
DataInput
readDouble in interface DataInputpublic float readFloat()
DataInput
readFloat in interface DataInputpublic short readShort()
DataInput
readShort in interface DataInputpublic int readInt()
DataInput
readInt in interface DataInputpublic long readUnsignedInt()
DataInput
readUnsignedInt in interface DataInputpublic int readUnsignedShort()
public String readUTF()
DataInput
readUTF in interface DataInputpublic String readUTFBytes(int length)
DataInput
readUTFBytes in interface DataInputlength - the number of bytes to read
public String readMultiByte(int length,
String charset)
DataInput
readMultiByte in interface DataInputlength - the number of bytes to readcharset - the character set to use to decode the bytes
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||