Package org.jppf.serialization
Class JPPFObjectOutputStream
java.lang.Object
java.io.OutputStream
java.io.ObjectOutputStream
org.jppf.serialization.JPPFObjectOutputStream
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,ObjectOutput,ObjectStreamConstants,AutoCloseable
Implementation of
ObjectOutputStream that writes 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 ObjectOutputStream specification is respected:
- transient fields are not serialized
private void writeObject(ObjectOutputStream)is used whenever implemented- the
Externalizableinterface is respected
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested classes/interfaces inherited from class java.io.ObjectOutputStream
ObjectOutputStream.PutField -
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 stream.JPPFObjectOutputStream(OutputStream out, org.jppf.serialization.Serializer serializer) Initialize this object stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidvoidflush()voidwrite(byte[] buf) voidwrite(byte[] buf, int off, int len) voidwrite(int val) voidwriteBoolean(boolean val) voidwriteByte(int val) voidwriteBytes(String str) voidwriteChar(int val) voidwriteChars(String str) voidwriteDouble(double val) voidvoidwriteFloat(float val) voidwriteInt(int val) voidwriteLong(long val) protected final voidvoidwriteShort(int val) voidMethods inherited from class java.io.ObjectOutputStream
annotateClass, annotateProxyClass, drain, enableReplaceObject, replaceObject, reset, useProtocolVersion, writeClassDescriptor, writeObject, writeStreamHeader, writeUnsharedMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
JPPFObjectOutputStream
Initialize this object stream.- Parameters:
out- the stream to write objects to.- Throws:
IOException- if any error occurs.
-
JPPFObjectOutputStream
public JPPFObjectOutputStream(OutputStream out, org.jppf.serialization.Serializer serializer) throws IOException Initialize this object stream.- Parameters:
out- the stream to write objects to.serializer- the serializer to use.- Throws:
IOException- if any error occurs.
-
-
Method Details
-
writeObjectOverride
- Overrides:
writeObjectOverridein classObjectOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceDataOutput- Overrides:
writeBooleanin classObjectOutputStream- Throws:
IOException
-
writeByte
- Specified by:
writeBytein interfaceDataOutput- Overrides:
writeBytein classObjectOutputStream- Throws:
IOException
-
writeShort
- Specified by:
writeShortin interfaceDataOutput- Overrides:
writeShortin classObjectOutputStream- Throws:
IOException
-
writeChar
- Specified by:
writeCharin interfaceDataOutput- Overrides:
writeCharin classObjectOutputStream- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceDataOutput- Overrides:
writeIntin classObjectOutputStream- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceDataOutput- Overrides:
writeLongin classObjectOutputStream- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceDataOutput- Overrides:
writeFloatin classObjectOutputStream- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceDataOutput- Overrides:
writeDoublein classObjectOutputStream- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceDataOutput- Overrides:
writeBytesin classObjectOutputStream- Throws:
IOException
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput- Overrides:
writeCharsin classObjectOutputStream- Throws:
IOException
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput- Overrides:
writeUTFin classObjectOutputStream- Throws:
IOException
-
defaultWriteObject
- Overrides:
defaultWriteObjectin classObjectOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Overrides:
flushin classObjectOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Overrides:
closein classObjectOutputStream- Throws:
IOException
-
putFields
- Overrides:
putFieldsin classObjectOutputStream- Throws:
IOException
-
writeFields
- Overrides:
writeFieldsin classObjectOutputStream- Throws:
IOException
-