|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ExtendedObjectInput
The ExtendedObjectInput interface extends ObjectInput and add two methods that
help dealing with reflection (getReflection()) and field assignments
(readAndSetProperty(Object, Property)).
Implementation instances of this interface are passed as parameter to
ExtendedObjectCodec.decode(ExtendedObjectInput, Object) method calls.
Several methods of the ObjectInput interface are tagged as deprecated and should never be used within ExtendedObjectCodec.decode(...) calls (implementations must throw UnsupportedOperationException errors).
ExtendedObjectCodec,
ExtendedObjectOutput,
JMFDeserializer,
InputContext| Method Summary | |
|---|---|
String |
getAlias(String className)
|
Reflection |
getReflection()
Return the Reflection registered in the global JMF SharedContext. |
int |
read()
Deprecated. Implementation must throw a UnsupportedOperationException error. |
int |
read(byte[] b)
Deprecated. Implementation must throw a UnsupportedOperationException error. |
int |
read(byte[] b,
int off,
int len)
Deprecated. Implementation must throw a UnsupportedOperationException error. |
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. |
void |
readFully(byte[] b)
Deprecated. Implementation must throw a UnsupportedOperationException error. |
void |
readFully(byte[] b,
int off,
int len)
Deprecated. Implementation must throw a UnsupportedOperationException error. |
String |
readLine()
Deprecated. Implementation must throw a UnsupportedOperationException error. |
long |
skip(long n)
Deprecated. Implementation must throw a UnsupportedOperationException error. |
int |
skipBytes(int n)
Deprecated. Implementation must throw a UnsupportedOperationException error. |
| Methods inherited from interface java.io.ObjectInput |
|---|
available, close, readObject |
| Methods inherited from interface java.io.DataInput |
|---|
readBoolean, readByte, readChar, readDouble, readFloat, readInt, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF |
| Method Detail |
|---|
Reflection getReflection()
Reflection registered in the global JMF SharedContext.
String getAlias(String className)
void readAndSetProperty(Object obj,
Property property)
throws IOException,
ClassNotFoundException,
IllegalAccessException,
InvocationTargetException
Field 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());
obj - 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
@Deprecated
int read()
throws IOException
UnsupportedOperationException error.
ExtendedObjectCodec.
Use DataInput.readByte() instead.
read in interface ObjectInputIOException
@Deprecated
int read(byte[] b)
throws IOException
UnsupportedOperationException error.
ExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.
read in interface ObjectInputIOException
@Deprecated
int read(byte[] b,
int off,
int len)
throws IOException
UnsupportedOperationException error.
ExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.
read in interface ObjectInputIOException
@Deprecated
void readFully(byte[] b)
throws IOException
UnsupportedOperationException error.
ExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.
readFully in interface DataInputIOException
@Deprecated
void readFully(byte[] b,
int off,
int len)
throws IOException
UnsupportedOperationException error.
ExtendedObjectCodec.
Use (byte[])ObjectInput.readObject() instead.
readFully in interface DataInputIOException
@Deprecated
String readLine()
throws IOException
UnsupportedOperationException error.
ExtendedObjectCodec.
Use DataInput.readUTF() instead and parse the String.
readLine in interface DataInputIOException
@Deprecated
int skipBytes(int n)
throws IOException
UnsupportedOperationException error.
ExtendedObjectCodec.
skipBytes in interface DataInputIOException
@Deprecated
long skip(long n)
throws IOException
UnsupportedOperationException error.
ExtendedObjectCodec.
skip in interface ObjectInputIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||