public class JMFDeserializer extends Object implements InputContext
| Modifier and Type | Field and Description |
|---|---|
protected CodecRegistry |
codecRegistry |
protected SharedContext |
context |
protected InputStream |
inputStream |
protected List<Object> |
storedObjects |
protected List<String> |
storedStrings |
CLIENT_PERSISTENCE_COLLECTION_PACKAGE, JMF_1111_1010, JMF_1111_1011, JMF_1111_1100, JMF_1111_1101, JMF_1111_1110, JMF_1111_1111, JMF_ARRAY, JMF_ARRAY_LIST, JMF_BIG_DECIMAL, JMF_BIG_INTEGER, JMF_BOOLEAN, JMF_BOOLEAN_OBJECT, JMF_BYTE, JMF_BYTE_OBJECT, JMF_CHARACTER, JMF_CHARACTER_OBJECT, JMF_CLASS, JMF_DATE, JMF_DOUBLE, JMF_DOUBLE_OBJECT, JMF_ENUM, JMF_FLOAT, JMF_FLOAT_OBJECT, JMF_HASH_MAP, JMF_HASH_SET, JMF_INTEGER, JMF_INTEGER_OBJECT, JMF_LONG, JMF_LONG_OBJECT, JMF_NULL, JMF_OBJECT, JMF_OBJECT_END, JMF_SHORT, JMF_SHORT_OBJECT, JMF_SQL_DATE, JMF_SQL_TIME, JMF_SQL_TIMESTAMP, JMF_STRING, JMF_X011_1100, JMF_X011_1101, JMF_X011_1110, JMF_X011_1111, JMF_XX01_1110, JMF_XX01_1111, JMF_XXX0_1101, JMF_XXX0_1110, JMF_XXX0_1111, JMF_XXXX_0111, UTF8| Constructor and Description |
|---|
JMFDeserializer(InputStream is,
SharedContext context) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected final List<String> storedStrings
protected final List<Object> storedObjects
protected final InputStream inputStream
protected final SharedContext context
protected final CodecRegistry codecRegistry
public JMFDeserializer(InputStream is, SharedContext context)
public boolean readBoolean() throws IOException
readBoolean in interface DataInputIOExceptionpublic byte readByte() throws IOException
readByte in interface DataInputIOExceptionpublic int readUnsignedByte() throws IOException
readUnsignedByte in interface DataInputIOExceptionpublic short readShort() throws IOException
readShort in interface DataInputIOExceptionpublic int readUnsignedShort() throws IOException
readUnsignedShort in interface DataInputIOExceptionpublic char readChar() throws IOException
readChar in interface DataInputIOExceptionpublic int readInt() throws IOException
readInt in interface DataInputIOExceptionpublic long readLong() throws IOException
readLong in interface DataInputIOExceptionpublic float readFloat() throws IOException
readFloat in interface DataInputIOExceptionpublic double readDouble() throws IOException
readDouble in interface DataInputIOExceptionpublic String readUTF() throws IOException
readUTF in interface DataInputIOExceptionpublic Object readObject() throws ClassNotFoundException, IOException
readObject in interface ObjectInputClassNotFoundExceptionIOExceptionpublic int available() throws IOException
available in interface ObjectInputIOExceptionpublic void close() throws IOException
close in interface ObjectInputclose in interface AutoCloseableIOException@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 InputContextpublic int safeRead() throws IOException
safeRead in interface InputContextIOExceptionpublic void safeReadFully(byte[] b) throws IOException
safeReadFully in interface InputContextIOExceptionpublic void safeReadFully(byte[] b, int off, int len) throws IOException
safeReadFully in interface InputContextIOExceptionpublic 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 InputContextpublic 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 ExtendedObjectInputpublic 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