| java.lang.Object java.io.InputStream java.io.ObjectInputStream org.apache.wsif.base.WSIFObjectInputStream
WSIFObjectInputStream | class WSIFObjectInputStream extends ObjectInputStream (Code) | | Class FObjectInputStream overloads the class ObjectInputStream
to solve the bug reported under BugID
4171142 .
If an object contains primitiv data types and you try to serialize/deserialize
it than you will get an ClassNotFoundException for the primitiv data type.
Reason for this exception is that the ObjectInputStream try to resolve the
data type from java.lang.<primitiv> which does not work.
The solution for the problem is to override the method resolveClass and to
bypass the resolution for primitiv data types.
author: Alexander Dietzsch |
Constructor Summary | |
| WSIFObjectInputStream(InputStream in) Create an ObjectInputStream that reads from the specified InputStream.
The stream header containing the magic number and version number
are read from the stream and verified. |
Method Summary | |
protected Class | resolveClass(ObjectStreamClass v) 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 ObjectOutputStream is
annotateClass. |
WSIFObjectInputStream | WSIFObjectInputStream(InputStream in) throws IOException, StreamCorruptedException(Code) | | Create an ObjectInputStream that reads from the specified InputStream.
The stream header containing the magic number and version number
are read from the stream and verified. This method will block
until the corresponding ObjectOutputStream has written and flushed the
header.
Parameters: in - the underlying InputStream from which to read exception: StreamCorruptedException - The version or magic number areincorrect. exception: IOException - An exception occurred in the underlying stream. |
resolveClass | protected Class resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException(Code) | | 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 ObjectOutputStream is
annotateClass. This method will be invoked only once for each
unique class in the stream. This method can be implemented by
subclasses to use an alternate loading mechanism but must
return a Class object. Once returned, the serialVersionUID of the
class is compared to the serialVersionUID of the serialized class.
If there is a mismatch, the deserialization fails and an exception
is raised.
By default the class name is resolved relative to the class
that called readObject.
Parameters: v - an instance of class ObjectStreamClass a Class object corresponding to v exception: IOException - Any of the usual Input/Output exceptions. exception: ClassNotFoundException - If class ofa serialized object cannot be found. |
Methods inherited from java.io.ObjectInputStream | public int available() throws IOException(Code)(Java Doc) public void close() throws IOException(Code)(Java Doc) public void defaultReadObject() throws IOException, ClassNotFoundException(Code)(Java Doc) protected boolean enableResolveObject(boolean enable) throws SecurityException(Code)(Java Doc) public int read() throws IOException(Code)(Java Doc) public int read(byte[] buf, int off, int len) throws IOException(Code)(Java Doc) public boolean readBoolean() throws IOException(Code)(Java Doc) public byte readByte() throws IOException(Code)(Java Doc) public char readChar() throws IOException(Code)(Java Doc) protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException(Code)(Java Doc) public double readDouble() throws IOException(Code)(Java Doc) public ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException(Code)(Java Doc) public float readFloat() throws IOException(Code)(Java Doc) public void readFully(byte[] buf) throws IOException(Code)(Java Doc) public void readFully(byte[] buf, int off, int len) throws IOException(Code)(Java Doc) public int readInt() throws IOException(Code)(Java Doc) public String readLine() throws IOException(Code)(Java Doc) public long readLong() throws IOException(Code)(Java Doc) final public Object readObject() throws IOException, ClassNotFoundException(Code)(Java Doc) protected Object readObjectOverride() throws IOException, ClassNotFoundException(Code)(Java Doc) public short readShort() throws IOException(Code)(Java Doc) protected void readStreamHeader() throws IOException, StreamCorruptedException(Code)(Java Doc) public String readUTF() throws IOException(Code)(Java Doc) public Object readUnshared() throws IOException, ClassNotFoundException(Code)(Java Doc) public int readUnsignedByte() throws IOException(Code)(Java Doc) public int readUnsignedShort() throws IOException(Code)(Java Doc) public void registerValidation(ObjectInputValidation obj, int prio) throws NotActiveException, InvalidObjectException(Code)(Java Doc) protected Class> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException(Code)(Java Doc) protected Object resolveObject(Object obj) throws IOException(Code)(Java Doc) protected Class> resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException(Code)(Java Doc) public int skipBytes(int len) throws IOException(Code)(Java Doc)
|
|
|