public class MarshalInputStream extends AnnotatedObjectInputStream
AnnotatedObjectInputStream that provides local storage of already
resolved class descriptors, to optimize the marshaling.| Modifier and Type | Class and Description |
|---|---|
static class |
MarshalInputStream.Context |
ObjectInputStream.GetFieldbaseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING| Constructor and Description |
|---|
MarshalInputStream(InputStream in) |
MarshalInputStream(InputStream in,
MarshalInputStream.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeContext() |
static MarshalInputStream.Context |
createContext() |
protected String |
readAnnotation(ObjectStreamClass desc)
Reads and returns a class annotation string value (possibly
null) that was
written by a corresponding AnnotatedObjectOutputStream implementation. |
protected ObjectStreamClass |
readClassDescriptor()
Overrides the super method and tries to get the class descriptor from a local map.
|
Object |
readRepetitiveObject()
Reads a repetitive object which was written by
MarshalOutputStream.writeRepetitiveObject(java.lang.Object). |
Object |
readSmartExternalizable() |
protected void |
readStreamHeader() |
void |
resetContext() |
protected Class<?> |
resolveClass(ObjectStreamClass classDesc)
Resolves the appropriate
Class object for the stream class descriptor
classDesc. |
protected Class<?> |
resolveProxyClass(String[] interfaceNames)
Resolves the appropriate
Class object for the proxy class described by the interface
names interfaceNames. |
resolveClassavailable, close, defaultReadObject, enableResolveObject, read, read, readBoolean, readByte, readChar, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readObjectOverride, readShort, readUnshared, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, resolveObject, skipBytesmark, markSupported, read, reset, skipclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitread, skippublic MarshalInputStream(InputStream in) throws IOException
in - input stream to wrap.IOExceptionpublic MarshalInputStream(InputStream in, MarshalInputStream.Context context) throws IOException
IOExceptionpublic static MarshalInputStream.Context createContext()
public Object readRepetitiveObject() throws IOException, ClassNotFoundException
MarshalOutputStream.writeRepetitiveObject(java.lang.Object).IOExceptionClassNotFoundExceptionpublic Object readSmartExternalizable() throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionprotected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException
Class object for the stream class descriptor
classDesc.
MarshalInputStream implements this method as follows:
First tries to check if this class descriptor was already resolved if it does return the class.
Else invokes the super class implementation.
resolveClass in class AnnotatedObjectInputStreamclassDesc - the stream class descriptor to resolveIOException - if readAnnotation throws an IOException,
or if ClassLoading.loadClass throws a
MalformedURLExceptionClassNotFoundException - if readAnnotation or ClassLoading.loadClass
throws a ClassNotFoundExceptionNullPointerException - if classDesc is nullprotected String readAnnotation(ObjectStreamClass desc) throws IOException, ClassNotFoundException
AnnotatedObjectInputStreamnull) that was
written by a corresponding AnnotatedObjectOutputStream implementation.
AnnotatedObjectInputStream implements this method to just read the annotation
value from this stream using readUnshared, and if
readUnshared returns a non-null value that is not a
String, an InvalidObjectException is thrown.
A subclass can override this method to read the annotation from a different location.
readAnnotation in class AnnotatedObjectInputStreamnull)IOException - if an I/O exception occurs reading the annotationClassNotFoundException - if a ClassNotFoundException occurs reading the
annotationprotected Class<?> resolveProxyClass(String[] interfaceNames) throws IOException, ClassNotFoundException
Class object for the proxy class described by the interface
names interfaceNames.
MarshalInputStream implements this method as follows:
First tries to check if this class descriptor was already resolved if it does return the class.
Else invokes the super class implementation
resolveProxyClass in class ObjectInputStreaminterfaceNames - the list of interface names that were deserialized in the proxy class
descriptorIOException - if readAnnotation throws an IOException,
or if ClassLoading.loadProxyClass throws a
MalformedURLExceptionClassNotFoundException - if readAnnotation or ClassLoading.loadProxyClass
throws a ClassNotFoundExceptionNullPointerException - if interfaceNames is null or if any
element of interfaceNames is nullprotected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException
readClassDescriptor in class ObjectInputStreamIOExceptionClassNotFoundExceptionprotected void readStreamHeader()
throws IOException
readStreamHeader in class ObjectInputStreamIOExceptionpublic void closeContext()
public void resetContext()
Copyright © GigaSpaces.