|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.granite.messaging.jmf.JMFDeserializer
public class JMFDeserializer
| Field Summary | |
|---|---|
protected CodecRegistry |
codecRegistry
|
protected SharedContext |
context
|
protected InputStream |
inputStream
|
protected List<Object> |
storedObjects
|
protected List<String> |
storedStrings
|
| Constructor Summary | |
|---|---|
JMFDeserializer(InputStream is,
SharedContext context)
|
|
| Method Summary | |
|---|---|
int |
addSharedObject(Object o)
|
int |
addSharedString(String s)
|
int |
addUnresolvedSharedObject(String className)
|
int |
available()
|
void |
close()
|
String |
getAlias(String remoteAlias)
|
InputStream |
getInputStream()
|
Reflection |
getReflection()
Return the Reflection registered in the global JMF SharedContext. |
SharedContext |
getSharedContext()
|
Object |
getSharedObject(int index)
|
String |
getSharedString(int index)
|
int |
read()
Deprecated. |
int |
read(byte[] b)
Deprecated. |
int |
read(byte[] b,
int off,
int len)
Deprecated. |
void |
readAndSetProperty(Object obj,
Property property)
Read the next data in the current input stream and set the given field of the given Object obj with this data. |
boolean |
readBoolean()
|
byte |
readByte()
|
char |
readChar()
|
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] b)
Deprecated. |
void |
readFully(byte[] b,
int off,
int len)
Deprecated. |
int |
readInt()
|
String |
readLine()
Deprecated. |
long |
readLong()
|
Object |
readObject()
|
short |
readShort()
|
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
String |
readUTF()
|
int |
safeRead()
|
void |
safeReadFully(byte[] b)
|
void |
safeReadFully(byte[] b,
int off,
int len)
|
void |
safeSkip(long n)
|
Object |
setUnresolvedSharedObject(int index,
Object o)
|
long |
skip(long n)
Deprecated. |
int |
skipBytes(int n)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final List<String> storedStrings
protected final List<Object> storedObjects
protected final InputStream inputStream
protected final SharedContext context
protected final CodecRegistry codecRegistry
| Constructor Detail |
|---|
public JMFDeserializer(InputStream is,
SharedContext context)
| Method Detail |
|---|
public boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOException
public byte readByte()
throws IOException
readByte in interface DataInputIOException
public int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOException
public short readShort()
throws IOException
readShort in interface DataInputIOException
public int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOException
public char readChar()
throws IOException
readChar in interface DataInputIOException
public int readInt()
throws IOException
readInt in interface DataInputIOException
public long readLong()
throws IOException
readLong in interface DataInputIOException
public float readFloat()
throws IOException
readFloat in interface DataInputIOException
public double readDouble()
throws IOException
readDouble in interface DataInputIOException
public String readUTF()
throws IOException
readUTF in interface DataInputIOException
public Object readObject()
throws ClassNotFoundException,
IOException
readObject in interface ObjectInputClassNotFoundException
IOException
public int available()
throws IOException
available in interface ObjectInputIOException
public void close()
throws IOException
close in interface ObjectInputIOException
@Deprecated
public int read()
throws IOException
ExtendedObjectInputExtendedObjectCodec.
Use DataInput.readByte() instead.
read in interface ObjectInputread in interface ExtendedObjectInputIOException
@Deprecated
public int read(byte[] b)
throws IOException
ExtendedObjectInputExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.
read in interface ObjectInputread in interface ExtendedObjectInputIOException
@Deprecated
public int read(byte[] b,
int off,
int len)
throws IOException
ExtendedObjectInputExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.
read in interface ObjectInputread in interface ExtendedObjectInputIOException
@Deprecated
public void readFully(byte[] b)
throws IOException
ExtendedObjectInputExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.
readFully in interface DataInputreadFully in interface ExtendedObjectInputIOException
@Deprecated
public void readFully(byte[] b,
int off,
int len)
throws IOException
ExtendedObjectInputExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.
readFully in interface DataInputreadFully in interface ExtendedObjectInputIOException
@Deprecated
public String readLine()
throws IOException
ExtendedObjectInputExtendedObjectCodec.
Use DataInput.readUTF() instead and parse the String.
readLine in interface DataInputreadLine in interface ExtendedObjectInputIOException
@Deprecated
public int skipBytes(int n)
throws IOException
ExtendedObjectInputExtendedObjectCodec.
skipBytes in interface DataInputskipBytes in interface ExtendedObjectInputIOException
@Deprecated
public long skip(long n)
throws IOException
ExtendedObjectInputExtendedObjectCodec.
skip in interface ObjectInputskip in interface ExtendedObjectInputIOExceptionpublic SharedContext getSharedContext()
getSharedContext in interface InputContextpublic InputStream getInputStream()
getInputStream in interface InputContext
public int safeRead()
throws IOException
safeRead in interface InputContextIOException
public void safeReadFully(byte[] b)
throws IOException
safeReadFully in interface InputContextIOException
public void safeReadFully(byte[] b,
int off,
int len)
throws IOException
safeReadFully in interface InputContextIOException
public void safeSkip(long n)
throws IOException
safeSkip in interface InputContextIOExceptionpublic int addSharedString(String s)
addSharedString in interface InputContextpublic String getSharedString(int index)
getSharedString in interface InputContextpublic int addSharedObject(Object o)
addSharedObject in interface InputContextpublic Object getSharedObject(int index)
getSharedObject in interface InputContextpublic int addUnresolvedSharedObject(String className)
addUnresolvedSharedObject in interface InputContext
public Object setUnresolvedSharedObject(int index,
Object o)
setUnresolvedSharedObject in interface InputContextpublic Reflection getReflection()
ExtendedObjectInputReflection registered in the global JMF SharedContext.
getReflection in interface ExtendedObjectInputpublic String getAlias(String remoteAlias)
getAlias in interface ExtendedObjectInput
public void readAndSetProperty(Object obj,
Property property)
throws IOException,
ClassNotFoundException,
IllegalAccessException,
InvocationTargetException
ExtendedObjectInputField to this
data without knowing its type.
For example, given a field f1 of type boolean (the primitive type) and
a field f2 of type int (the primitive type):
in.readAndSetProperty(obj, f1); in.readAndSetProperty(obj, f2);is equivalent to:
f1.setBoolean(obj, in.readBoolean()); f2.setInt(obj, in.readInt());
readAndSetProperty in interface ExtendedObjectInputobj - The instance of the class declaring the property.property - The property to set with the read value.
IOException - If any I/O error occur.
JMFEncodingException - If read data isn't of expected type (ie. the type of the given property).
ClassNotFoundException - If the class of a serialized object cannot be found.
IllegalAccessException - If the property cannot be accessed.
InvocationTargetException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||