Unmarshaller, which may be used by legacy ObjectInputStream-based
applications that wish to use the marshalling framework.
| Modifier and Type | Field and Description |
|---|---|
| private Unmarshaller |
| Access | Constructor and Description |
|---|---|
| public | UnmarshallingObjectInputStream(final Unmarshaller
the delegate unmarshaller unmarshaller, final InputStream the input stream to read from stream)Construct a new instance which delegates to the given unmarshaller, reading from the given input. |
| public | UnmarshallingObjectInputStream(final Unmarshaller
the delegate unmarshaller unmarshaller, final ByteInput the input stream to read from byteInput)Construct a new instance which delegates to the given unmarshaller, reading from the given input. |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Overrides java. Implements java. |
| public void | close()
Overrides java. Implements java. |
| public void | defaultReadObject()
Overrides java. |
| protected final boolean | enableResolveObject(final boolean
true for enabling use of enable)
Enables the stream to do replacement of objects read from the stream.
resolveObject for
every object being deserialized |
| public int | read()
Overrides java. Implements java. |
| public int | read(final byte[]
the buffer into which the data is read b)Overrides java. Implements java. |
| public int | read(final byte[]
the buffer into which the data is read b, final int the start offset in the destination array off, final int bufthe maximum number of bytes read len)Overrides java. Implements java. |
| public boolean | readBoolean()
Overrides java. Implements java. |
| public byte | readByte()
Overrides java. Implements java. |
| public char | readChar()
Overrides java. Implements java. |
| protected final ObjectStreamClass | readClassDescriptor()
Read a class descriptor from the serialization stream.
|
| public double | readDouble()
Overrides java. Implements java. |
| public ObjectInputStream. | |
| public float | readFloat()
Overrides java. Implements java. |
| public void | readFully(final byte[]
the buffer into which the data is read b)Overrides java. Implements java. |
| public void | readFully(final byte[]
the buffer into which the data is read b, final int the start offset into the data array off, final int bufthe maximum number of bytes to read len)Overrides java. Implements java. |
| public int | readInt()
Overrides java. Implements java. |
| public String | readLine()
Overrides java. Implements java.
Deprecated
Reads in a line that has been terminated by a \n, \r, \r\n or EOF.
|
| public long | readLong()
Overrides java. Implements java. |
| protected Object | readObjectOverride()
Overrides java. |
| public Object | |
| public short | readShort()
Overrides java. Implements java. |
| protected final void | readStreamHeader()
Overrides java. |
| public Object | readUnshared()
Overrides java. |
| public int | readUnsignedByte()
Overrides java. Implements java. |
| public int | readUnsignedShort()
Overrides java. Implements java. |
| public String | readUTF()
Overrides java. Implements java. |
| public void | registerValidation(final ObjectInputValidation
ignored obj, final int ignored prio)Overrides java. |
| protected final Class | resolveClass(final ObjectStreamClass
an instance of class desc)ObjectStreamClassOverrides java. |
| protected final Object | resolveObject(final Object
object to be substituted obj)Overrides java. |
| protected final Class | resolveProxyClass(final String[]
the list of interface names that were
deserialized in the proxy class descriptor interfaces)Overrides java. |
| public long | skip(final long
the number of bytes to be skipped n)Overrides java. Implements java. |
| public int | skipBytes(final int
the number of bytes to be skipped n)Overrides java. Implements java. |
| unmarshaller | back to summary |
|---|---|
| private Unmarshaller unmarshaller | |
| UnmarshallingObjectInputStream | back to summary |
|---|---|
| public UnmarshallingObjectInputStream(final Unmarshaller unmarshaller, final InputStream stream) throws IOException, SecurityException Construct a new instance which delegates to the given unmarshaller, reading from the given input. The unmarshaller will read from the input stream until it is closed.
| |
| UnmarshallingObjectInputStream | back to summary |
|---|---|
| public UnmarshallingObjectInputStream(final Unmarshaller unmarshaller, final ByteInput byteInput) throws IOException, SecurityException Construct a new instance which delegates to the given unmarshaller, reading from the given input. The unmarshaller will read from the input stream until it is closed.
| |
| available | back to summary |
|---|---|
| public int available() throws IOException Overrides java. Implements java. Doc from java. Returns the number of bytes that can be read without blocking.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException, IllegalStateException Overrides java. Implements java. Doc from java. Closes the input stream. Must be called to release any resources associated with the stream.
| |
| defaultReadObject | back to summary |
|---|---|
| public void defaultReadObject() throws IllegalStateException Overrides java. May not be invoked in this context.
| |
| enableResolveObject | back to summary |
|---|---|
| protected final boolean enableResolveObject(final boolean enable) throws IllegalStateException Overrides java. Doc from java. Enables the stream to do replacement of objects read from the stream. When
enabled, the If object replacement is currently not enabled, and
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Implements java. Doc from java. Reads a byte of data. This method will block if no input is available.
| |
| read | back to summary |
|---|---|
| public int read(final byte[] b) throws IOException Overrides java. Implements java. Doc from java. Reads into an array of bytes. This method will block until some input is available.
| |
| read | back to summary |
|---|---|
| public int read(final byte[] b, final int off, final int len) throws IOException Overrides java. Implements java. Doc from java. Reads into an array of bytes. This method will block until some input is available. Consider using java.io.DataInputStream.readFully to read exactly 'length' bytes.
| |
| readBoolean | back to summary |
|---|---|
| public boolean readBoolean() throws IOException Overrides java. Implements java. Doc from java. Reads in a boolean.
| |
| readByte | back to summary |
|---|---|
| public byte readByte() throws IOException Overrides java. Implements java. Doc from java. Reads an 8-bit byte.
| |
| readChar | back to summary |
|---|---|
| public char readChar() throws IOException Overrides java. Implements java. Doc from java. Reads a 16-bit char.
| |
| readClassDescriptor | back to summary |
|---|---|
| protected final ObjectStreamClass readClassDescriptor() throws IllegalStateException Overrides java. Doc from java. Read a class descriptor from the serialization stream. This method is
called when the ObjectInputStream expects a class descriptor as the next
item in the serialization stream. Subclasses of ObjectInputStream may
override this method to read in class descriptors that have been written
in non-standard formats (by subclasses of ObjectOutputStream which have
overridden the
| |
| readDouble | back to summary |
|---|---|
| public double readDouble() throws IOException Overrides java. Implements java. Doc from java. Reads a 64-bit double.
| |
| readFields | back to summary |
|---|---|
| public ObjectInputStream. Overrides java. May not be invoked in this context.
| |
| readFloat | back to summary |
|---|---|
| public float readFloat() throws IOException Overrides java. Implements java. Doc from java. Reads a 32-bit float.
| |
| readFully | back to summary |
|---|---|
| public void readFully(final byte[] b) throws IOException Overrides java. Implements java. Doc from java. Reads bytes, blocking until all bytes are read.
| |
| readFully | back to summary |
|---|---|
| public void readFully(final byte[] b, final int off, final int len) throws IOException Overrides java. Implements java. Doc from java. Reads bytes, blocking until all bytes are read.
| |
| readInt | back to summary |
|---|---|
| public int readInt() throws IOException Overrides java. Implements java. Doc from java. Reads a 32-bit int.
| |
| readLine | back to summary |
|---|---|
| public String readLine() throws IOException Overrides java. Implements java. Doc from java. Deprecated
Reads in a line that has been terminated by a \n, \r, \r\n or EOF.
| |
| readLong | back to summary |
|---|---|
| public long readLong() throws IOException Overrides java. Implements java. Doc from java. Reads a 64-bit long.
| |
| readObjectOverride | back to summary |
|---|---|
| protected Object readObjectOverride() throws ClassNotFoundException, IOException Overrides java. Doc from java. This method is called by trusted subclasses of ObjectInputStream that constructed ObjectInputStream using the protected no-arg constructor. The subclass is expected to provide an override method with the modifier "final".
| |
| readObjectUnshared | back to summary |
|---|---|
| public Object readObjectUnshared() throws ClassNotFoundException, IOException | |
| readShort | back to summary |
|---|---|
| public short readShort() throws IOException Overrides java. Implements java. Doc from java. Reads a 16-bit short.
| |
| readStreamHeader | back to summary |
|---|---|
| protected final void readStreamHeader() throws IllegalStateException Overrides java. Doc from java. The readStreamHeader method is provided to allow subclasses to read and verify their own stream headers. It reads and verifies the magic number and version number. | |
| readUnshared | back to summary |
|---|---|
| public Object readUnshared() throws IOException, ClassNotFoundException Overrides java. Doc from java. Reads an "unshared" object from the ObjectInputStream. This method is identical to readObject, except that it prevents subsequent calls to readObject and readUnshared from returning additional references to the deserialized instance obtained via this call. Specifically:
The deserialization filter, when not ObjectInputStream subclasses which override this method can only be constructed in security contexts possessing the "enableSubclassImplementation" SerializablePermission; any attempt to instantiate such a subclass without this permission will cause a SecurityException to be thrown.
| |
| readUnsignedByte | back to summary |
|---|---|
| public int readUnsignedByte() throws IOException Overrides java. Implements java. Doc from java. Reads an unsigned 8-bit byte.
| |
| readUnsignedShort | back to summary |
|---|---|
| public int readUnsignedShort() throws IOException Overrides java. Implements java. Doc from java. Reads an unsigned 16-bit short.
| |
| readUTF | back to summary |
|---|---|
| public String readUTF() throws IOException Overrides java. Implements java. Doc from java. Reads a String in modified UTF-8 format.
| |
| registerValidation | back to summary |
|---|---|
| public void registerValidation(final ObjectInputValidation obj, final int prio) throws IllegalStateException Overrides java. May not be invoked in this context.
| |
| resolveClass | back to summary |
|---|---|
| protected final Class Overrides java. Doc from java. Load the local class equivalent of the specified stream class description. Subclasses may implement this method to allow classes to be fetched from an alternate source. The corresponding method in The default implementation of this method in
Class.forName(desc.getName(), false, loader) loader is the first class loader on the current
thread's stack (starting from the currently executing method) that is
neither the platform
class loader nor its ancestor; otherwise, loader is the
platform class loader. If this call results in a
ClassNotFoundException and the name of the passed
ObjectStreamClass instance is the Java language keyword
for a primitive type or void, then the Class object
representing that primitive type or void will be returned
(e.g., an ObjectStreamClass with the name
"int" will be resolved to Integer.TYPE).
Otherwise, the ClassNotFoundException will be thrown to
the caller of this method.
| |
| resolveObject | back to summary |
|---|---|
| protected final Object resolveObject(final Object obj) throws IllegalStateException Overrides java. Doc from java. This method will allow trusted subclasses of ObjectInputStream to substitute one object for another during deserialization. Replacing objects is disabled until enableResolveObject is called. The enableResolveObject method checks that the stream requesting to resolve object can be trusted. Every reference to serializable objects is passed to resolveObject. To ensure that the private state of objects is not unintentionally exposed only trusted streams may use resolveObject. This method is called after an object has been read but before it is returned from readObject. The default resolveObject method just returns the same object. When a subclass is replacing objects it must ensure that the substituted object is compatible with every field where the reference will be stored. Objects whose type is not a subclass of the type of the field or array element abort the deserialization by raising an exception and the object is not be stored. This method is called only once when each object is first encountered. All subsequent references to the object will be redirected to the new object. | |
| resolveProxyClass | back to summary |
|---|---|
| protected final Class Overrides java. Doc from java. Returns a proxy class that implements the interfaces named in a proxy class descriptor; subclasses may implement this method to read custom data from the stream along with the descriptors for dynamic proxy classes, allowing them to use an alternate loading mechanism for the interfaces and the proxy class. This method is called exactly once for each unique proxy class descriptor in the stream. The corresponding method in The default implementation of this method in
Class.forName(i, false, loader) loader is the first class loader on the current
thread's stack (starting from the currently executing method) that is
neither the platform
class loader nor its ancestor; otherwise, loader is the
platform class loader.
Unless any of the resolved interfaces are non-public, this same value
of loader is also the class loader passed to
Proxy.getProxyClass; if non-public interfaces are present,
their class loader is passed instead (if more than one non-public
interface class loader is encountered, an
IllegalAccessError is thrown).
If Proxy.getProxyClass throws an
IllegalArgumentException, resolveProxyClass
will throw a ClassNotFoundException containing the
IllegalArgumentException.
| |
| skip | back to summary |
|---|---|
| public long skip(final long n) throws IOException Overrides java. Implements java. Doc from java. Skips n bytes of input.
| |
| skipBytes | back to summary |
|---|---|
| public int skipBytes(final int n) throws IOException Overrides java. Implements java. Doc from java. Skips bytes.
| |