java.io.ObjectOutput
Streams to be used with serialization to write objects must implement this
interface. ObjectOutputStream is one example.
Known Indirect Subclasses
| ObjectOutputStream |
An ObjectOutputStream can be used to save Java objects into a stream where
the objects can be loaded later with an ObjectInputStream. |
Summary
Public Methods
write,
write,
write,
writeBoolean,
writeByte,
writeBytes,
writeChar,
writeChars,
writeDouble,
writeFloat,
writeInt,
writeLong,
writeShort,
writeUTF
Details
Public Methods
public
void
close()
Close this ObjectOutput. Concrete implementations of this class should
free any resources during close.
Throws
| IOException
| If an error occurs attempting to close this ObjectOutput.
|
public
void
flush()
Flush this ObjectOutput. Concrete implementations of this class should
ensure any pending writes are written out when this method is envoked.
Throws
| IOException
| If an error occurs attempting to flush this ObjectOutput.
|
public
void
write(byte[] buffer)
Writes the entire contents of the byte array
buffer to
this ObjectOutput.
Parameters
| buffer
| the buffer to be written |
Throws
| IOException
| If an error occurs attempting to write to this ObjectOutput.
|
public
void
write(int value)
Writes the specified int
value to this ObjectOutput.
Parameters
| value
| the int to be written |
Throws
| IOException
| If an error occurs attempting to write to this ObjectOutput.
|
public
void
write(byte[] buffer, int offset, int count)
Writes
count bytes from this byte array
buffer starting at offset
index to this
ObjectOutput.
Parameters
| buffer
| the buffer to be written |
| offset
| offset in buffer to get bytes |
| count
| number of bytes in buffer to write |
Throws
| IOException
| If an error occurs attempting to write to this ObjectOutput.
|
public
void
writeObject(Object obj)
Writes the specified object
obj to this ObjectOutput.
Parameters
| obj
| the object to be written |
Throws
| IOException
| If an error occurs attempting to write to this ObjectOutput.
|