public class JMFDeserializer extends java.lang.Object implements InputContext
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,ClassDescriptor> |
classDescriptors |
protected java.util.List<java.lang.String> |
classNames |
protected CodecRegistry |
codecRegistry |
protected SharedContext |
context |
protected java.io.InputStream |
inputStream |
protected java.util.List<java.lang.Object> |
objects |
protected java.util.List<java.lang.String> |
strings |
CLIENT_PERSISTENCE_COLLECTION_PACKAGE, JMF_1111_1110, JMF_1111_1111, 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_GENERIC_COLLECTION, JMF_GENERIC_MAP, JMF_HASH_MAP, JMF_HASH_SET, JMF_INTEGER, JMF_INTEGER_OBJECT, JMF_LOCALDATE, JMF_LOCALDATETIME, JMF_LOCALTIME, JMF_LONG, JMF_LONG_OBJECT, JMF_NULL, JMF_OBJECT, JMF_OBJECT_ARRAY, JMF_OBJECT_END, JMF_PRIMITIVE_ARRAY, 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_1101, JMF_XX01_1110, JMF_XX01_1111, JMF_XXXX_0111, UTF8| Constructor and Description |
|---|
JMFDeserializer(java.io.InputStream is,
SharedContext context) |
| Modifier and Type | Method and Description |
|---|---|
int |
addToClassNames(java.lang.String cn) |
int |
addToObjects(java.lang.Object o) |
int |
addToStrings(java.lang.String s) |
int |
addToUnresolvedObjects(java.lang.String className) |
int |
available() |
void |
close() |
java.lang.String |
getAlias(java.lang.String remoteAlias) |
ClassDescriptor |
getClassDescriptor(java.lang.Class<?> cls) |
ClassDescriptor |
getClassDescriptor(java.lang.String className) |
java.lang.String |
getClassName(int index) |
java.io.InputStream |
getInputStream() |
java.lang.Object |
getObject(int index) |
Reflection |
getReflection()
Return the
Reflection registered in the global JMF SharedContext. |
SharedContext |
getSharedContext() |
java.lang.String |
getString(int index) |
int |
read()
Deprecated.
|
int |
read(byte[] b)
Deprecated.
|
int |
read(byte[] b,
int off,
int len)
Deprecated.
|
void |
readAndSetProperty(java.lang.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() |
java.lang.String |
readLine()
Deprecated.
|
long |
readLong() |
java.lang.Object |
readObject() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
java.lang.String |
readUTF() |
int |
safeRead() |
void |
safeReadFully(byte[] b) |
void |
safeReadFully(byte[] b,
int off,
int len) |
long |
safeReadLong() |
void |
safeSkip(long n) |
java.lang.Object |
setUnresolvedObject(int index,
java.lang.Object o) |
long |
skip(long n)
Deprecated.
|
int |
skipBytes(int n)
Deprecated.
|
java.lang.String |
toDumpString() |
protected final java.util.List<java.lang.String> classNames
protected final java.util.List<java.lang.String> strings
protected final java.util.List<java.lang.Object> objects
protected final java.util.Map<java.lang.String,ClassDescriptor> classDescriptors
protected final java.io.InputStream inputStream
protected final SharedContext context
protected final CodecRegistry codecRegistry
public JMFDeserializer(java.io.InputStream is,
SharedContext context)
public boolean readBoolean()
throws java.io.IOException
readBoolean in interface java.io.DataInputjava.io.IOExceptionpublic byte readByte()
throws java.io.IOException
readByte in interface java.io.DataInputjava.io.IOExceptionpublic int readUnsignedByte()
throws java.io.IOException
readUnsignedByte in interface java.io.DataInputjava.io.IOExceptionpublic short readShort()
throws java.io.IOException
readShort in interface java.io.DataInputjava.io.IOExceptionpublic int readUnsignedShort()
throws java.io.IOException
readUnsignedShort in interface java.io.DataInputjava.io.IOExceptionpublic char readChar()
throws java.io.IOException
readChar in interface java.io.DataInputjava.io.IOExceptionpublic int readInt()
throws java.io.IOException
readInt in interface java.io.DataInputjava.io.IOExceptionpublic long readLong()
throws java.io.IOException
readLong in interface java.io.DataInputjava.io.IOExceptionpublic float readFloat()
throws java.io.IOException
readFloat in interface java.io.DataInputjava.io.IOExceptionpublic double readDouble()
throws java.io.IOException
readDouble in interface java.io.DataInputjava.io.IOExceptionpublic java.lang.String readUTF()
throws java.io.IOException
readUTF in interface java.io.DataInputjava.io.IOExceptionpublic java.lang.Object readObject()
throws java.lang.ClassNotFoundException,
java.io.IOException
readObject in interface java.io.ObjectInputjava.lang.ClassNotFoundExceptionjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in interface java.io.ObjectInputjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.ObjectInputclose in interface java.lang.AutoCloseablejava.io.IOException@Deprecated
public int read()
throws java.io.IOException
ExtendedObjectInputExtendedObjectCodec.
Use DataInput.readByte() instead.read in interface java.io.ObjectInputread in interface ExtendedObjectInputjava.io.IOException@Deprecated
public int read(byte[] b)
throws java.io.IOException
ExtendedObjectInputExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.read in interface java.io.ObjectInputread in interface ExtendedObjectInputjava.io.IOException@Deprecated
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
ExtendedObjectInputExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.read in interface java.io.ObjectInputread in interface ExtendedObjectInputjava.io.IOException@Deprecated
public void readFully(byte[] b)
throws java.io.IOException
ExtendedObjectInputExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.readFully in interface java.io.DataInputreadFully in interface ExtendedObjectInputjava.io.IOException@Deprecated
public void readFully(byte[] b,
int off,
int len)
throws java.io.IOException
ExtendedObjectInputExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.readFully in interface java.io.DataInputreadFully in interface ExtendedObjectInputjava.io.IOException@Deprecated
public java.lang.String readLine()
throws java.io.IOException
ExtendedObjectInputExtendedObjectCodec.
Use DataInput.readUTF() instead and parse the String.readLine in interface java.io.DataInputreadLine in interface ExtendedObjectInputjava.io.IOException@Deprecated
public int skipBytes(int n)
throws java.io.IOException
ExtendedObjectInputExtendedObjectCodec.skipBytes in interface java.io.DataInputskipBytes in interface ExtendedObjectInputjava.io.IOException@Deprecated
public long skip(long n)
throws java.io.IOException
ExtendedObjectInputExtendedObjectCodec.skip in interface java.io.ObjectInputskip in interface ExtendedObjectInputjava.io.IOExceptionpublic SharedContext getSharedContext()
getSharedContext in interface InputContextpublic java.io.InputStream getInputStream()
getInputStream in interface InputContextpublic int safeRead()
throws java.io.IOException
safeRead in interface InputContextjava.io.IOExceptionpublic long safeReadLong()
throws java.io.IOException
safeReadLong in interface InputContextjava.io.IOExceptionpublic void safeReadFully(byte[] b)
throws java.io.IOException
safeReadFully in interface InputContextjava.io.IOExceptionpublic void safeReadFully(byte[] b,
int off,
int len)
throws java.io.IOException
safeReadFully in interface InputContextjava.io.IOExceptionpublic void safeSkip(long n)
throws java.io.IOException
safeSkip in interface InputContextjava.io.IOExceptionpublic int addToClassNames(java.lang.String cn)
addToClassNames in interface InputContextpublic java.lang.String getClassName(int index)
getClassName in interface InputContextpublic ClassDescriptor getClassDescriptor(java.lang.String className) throws java.lang.ClassNotFoundException
getClassDescriptor in interface InputContextjava.lang.ClassNotFoundExceptionpublic ClassDescriptor getClassDescriptor(java.lang.Class<?> cls)
getClassDescriptor in interface InputContextpublic int addToStrings(java.lang.String s)
addToStrings in interface InputContextpublic java.lang.String getString(int index)
getString in interface InputContextpublic int addToObjects(java.lang.Object o)
addToObjects in interface InputContextpublic java.lang.Object getObject(int index)
getObject in interface InputContextpublic int addToUnresolvedObjects(java.lang.String className)
addToUnresolvedObjects in interface InputContextpublic java.lang.Object setUnresolvedObject(int index,
java.lang.Object o)
setUnresolvedObject in interface InputContextpublic Reflection getReflection()
ExtendedObjectInputReflection registered in the global JMF SharedContext.getReflection in interface ExtendedObjectInputpublic java.lang.String getAlias(java.lang.String remoteAlias)
getAlias in interface ExtendedObjectInputpublic void readAndSetProperty(java.lang.Object obj,
Property property)
throws java.io.IOException,
java.lang.ClassNotFoundException,
java.lang.IllegalAccessException,
java.lang.reflect.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.java.io.IOException - If any I/O error occur.JMFEncodingException - If read data isn't of expected type (ie. the type of the given property).java.lang.ClassNotFoundException - If the class of a serialized object cannot be found.java.lang.IllegalAccessException - If the property cannot be accessed.java.lang.reflect.InvocationTargetExceptionpublic java.lang.String toDumpString()