Top Description Methods
java.io

public Interface ObjectOutput

extends DataOutput, AutoCloseable
Known Direct Implementers
java.io.ObjectOutputStream

ObjectOutput extends the DataOutput interface to include writing of objects. DataOutput includes methods for output of primitive types, ObjectOutput extends that interface to include objects, arrays, and Strings.
Since
1.1
See Also
java.io.InputStream, java.io.ObjectOutputStream, java.io.ObjectInputStream

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.lang.AutoCloseable.close.

Closes the stream.

public void
flush()

Flushes the stream.

public void
write(int
the byte
b
)

Redeclares java.io.DataOutput.write.

Writes a byte.

public void
write(byte[]
the data to be written
b
)

Redeclares java.io.DataOutput.write.

Writes an array of bytes.

public void
write(byte[]
the data to be written
b
,
int
the start offset in the data
off
,
int
the number of bytes that are written
len
)

Redeclares java.io.DataOutput.write.

Writes a sub array of bytes.

public void
writeObject(Object
the object to be written
obj
)

Write an object to the underlying storage or stream.

Inherited from java.io.DataOutput:
writeBooleanwriteBytewriteByteswriteCharwriteCharswriteDoublewriteFloatwriteIntwriteLongwriteShortwriteUTF

Method Detail

closeback to summary
public void close() throws IOException

Redeclares java.lang.AutoCloseable.close.

Closes the stream. This method must be called to release any resources associated with the stream.

Exceptions
IOException:
If an I/O error has occurred.
flushback to summary
public void flush() throws IOException

Flushes the stream. This will write any buffered output bytes.

Exceptions
IOException:
If an I/O error has occurred.
writeback to summary
public void write(int b) throws IOException

Redeclares java.io.DataOutput.write.

Writes a byte. This method will block until the byte is actually written.

Parameters
b:int

the byte

Exceptions
IOException:
If an I/O error has occurred.
writeback to summary
public void write(byte[] b) throws IOException

Redeclares java.io.DataOutput.write.

Writes an array of bytes. This method will block until the bytes are actually written.

Parameters
b:byte[]

the data to be written

Exceptions
IOException:
If an I/O error has occurred.
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Redeclares java.io.DataOutput.write.

Writes a sub array of bytes.

Parameters
b:byte[]

the data to be written

off:int

the start offset in the data

len:int

the number of bytes that are written

Exceptions
IOException:
If an I/O error has occurred.
IndexOutOfBoundsException:
If off is negative, len is negative, or len is greater than b.length - off
writeObjectback to summary
public void writeObject(Object obj) throws IOException

Write an object to the underlying storage or stream. The class that implements this interface defines how the object is written.

Parameters
obj:Object

the object to be written

Exceptions
IOException:
Any of the usual Input/Output related exceptions.