ObjectOutputStream

public class ObjectOutputStream extends OutputStream
implements ObjectOutput ObjectStreamConstants

A specialized OutputStream that is able to write (serialize) Java objects as well as primitive data types (int, byte, char etc.). The data can later be loaded using an ObjectInputStream.

Nested Class Summary

class ObjectOutputStream.PutField PutField is an inner class to provide access to the persistent fields that are written to the target stream. 

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

ObjectOutputStream(OutputStream output)
Constructs a new ObjectOutputStream that writes to the OutputStream output.

Protected Constructor Summary

ObjectOutputStream()
Constructs a new ObjectOutputStream.

Public Method Summary

void
close()
Closes this stream.
void
defaultWriteObject()
Default method to write objects to this stream.
void
flush()
Writes buffered data to the target stream and calls the flush method of the target stream.
ObjectOutputStream.PutField
putFields()
Gets this stream's PutField object.
void
reset()
Resets the state of this stream.
void
useProtocolVersion(int version)
Sets the specified protocol version to be used by this stream.
void
write(byte[] buffer, int offset, int length)
Writes count bytes from the byte array buffer starting at offset index to the target stream.
void
write(int value)
Writes a single byte to the target stream.
void
writeBoolean(boolean value)
Writes a boolean to the target stream.
void
writeByte(int value)
Writes a byte (8 bit) to the target stream.
void
writeBytes(String value)
Writes the string value as a sequence of bytes to the target stream.
void
writeChar(int value)
Writes a character (16 bit) to the target stream.
void
writeChars(String value)
Writes the string value as a sequence of characters to the target stream.
void
writeDouble(double value)
Writes a double (64 bit) to the target stream.
void
writeFields()
Writes the fields of the object currently being written to the target stream.
void
writeFloat(float value)
Writes a float (32 bit) to the target stream.
void
writeInt(int value)
Writes an integer (32 bit) to the target stream.
void
writeLong(long value)
Writes a long (64 bit) to the target stream.
final void
writeObject(Object object)
Writes an object to the target stream.
void
writeShort(int value)
Writes a short (16 bit) to the target stream.
void