Package org.jppf.serialization
Class JPPFObjectInputStream
java.lang.Object
java.io.InputStream
java.io.ObjectInputStream
org.jppf.serialization.JPPFObjectInputStream
- All Implemented Interfaces:
Closeable,DataInput,ObjectInput,ObjectStreamConstants,AutoCloseable
Implementation of
ObjectInputStream that reads objects without regards to whether
they implement Serializable or not. This allows using non-serializable classes in
JPPF tasks, especially when their source code is not available.
The rest of the ObjectInputStream specification is respected:
- transient fields are not deserialized
private void readObject(ObjectInputStream)is used whenever implemented- the
Externalizableinterface is respected
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested classes/interfaces inherited from class java.io.ObjectInputStream
ObjectInputStream.GetField -
Field Summary
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, SERIAL_FILTER_PERMISSION, 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 Summary
ConstructorsConstructorDescriptionInitialize this object input stream with the specified stream.JPPFObjectInputStream(InputStream in, org.jppf.serialization.Deserializer deserializer) Initialize this object input stream with the specified stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidintread()intread(byte[] buf, int off, int len) booleanbytereadByte()charreadChar()doublefloatvoidreadFully(byte[] buf) voidreadFully(byte[] buf, int off, int len) intreadInt()readLine()longreadLong()protected ObjectshortintintreadUTF()intskipBytes(int len) Methods inherited from class java.io.ObjectInputStream
available, enableResolveObject, getObjectInputFilter, readClassDescriptor, readObject, readStreamHeader, readUnshared, registerValidation, resolveClass, resolveObject, resolveProxyClass, setObjectInputFilterMethods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.io.ObjectInput
read, skip
-
Constructor Details
-
JPPFObjectInputStream
Initialize this object input stream with the specified stream.- Parameters:
in- the stream to read data from.- Throws:
IOException- if an I/O error occurs.
-
JPPFObjectInputStream
public JPPFObjectInputStream(InputStream in, org.jppf.serialization.Deserializer deserializer) throws IOException Initialize this object input stream with the specified stream.- Parameters:
in- the stream to read data from.deserializer- the deserializer to use.- Throws:
IOException- if an I/O error occurs.
-
-
Method Details
-
readObjectOverride
- Overrides:
readObjectOverridein classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-
read
- Specified by:
readin interfaceObjectInput- Overrides:
readin classObjectInputStream- Throws:
IOException
-
read
- Specified by:
readin interfaceObjectInput- Overrides:
readin classObjectInputStream- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Overrides:
readBooleanin classObjectInputStream- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Overrides:
readBytein classObjectInputStream- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Overrides:
readCharin classObjectInputStream- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Overrides:
readShortin classObjectInputStream- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Overrides:
readIntin classObjectInputStream- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Overrides:
readLongin classObjectInputStream- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Overrides:
readFloatin classObjectInputStream- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Overrides:
readDoublein classObjectInputStream- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Overrides:
skipBytesin classObjectInputStream- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Overrides:
readUTFin classObjectInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectInput- Overrides:
closein classObjectInputStream- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Overrides:
readUnsignedBytein classObjectInputStream- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Overrides:
readUnsignedShortin classObjectInputStream- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Overrides:
readLinein classObjectInputStream- Throws:
IOException
-
defaultReadObject
- Overrides:
defaultReadObjectin classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-
readFields
- Overrides:
readFieldsin classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-