Skip to content

Most visited

Recently visited

navigation
Added in API level 1

ObjectOutput

public interface ObjectOutput
implements DataOutput, AutoCloseable

java.io.ObjectOutput
Known Indirect Subclasses


Defines an interface for classes that allow writing serialized objects.

See also:

Summary

Public methods

abstract void close()

Closes the target stream.

abstract void flush()

Flushes the target stream.

abstract void write(byte[] buffer, int offset, int count)

Writes count bytes from the byte array buffer starting at position offset to the target stream.

abstract void write(byte[] buffer)

Writes the entire contents of the byte array buffer to the output stream.

abstract void write(int value)

Writes a single byte to the target stream.

abstract void writeObject(Object obj)

Writes the specified object obj to the target stream.

Inherited methods

From interface java.io.DataOutput
From interface java.lang.AutoCloseable

Public methods

close

Added in API level 1
void close ()

Closes the target stream. Implementations of this method should free any resources used by the stream.

Throws
IOException if an error occurs while closing the target stream.

flush

Added in API level 1
void flush ()

Flushes the target stream. Implementations of this method should ensure that any pending writes are written out to the target stream.

Throws
IOException if an error occurs while flushing the target stream.

write

Added in API level 1
void write (byte[] buffer, 
                int offset, 
                int count)

Writes count bytes from the byte array buffer starting at position offset to the target stream. Blocks until all bytes are written.

Parameters
buffer byte: the buffer to write.
offset int: the index of the first byte in buffer to write.
count int: the number of bytes from buffer to write to the target stream.
Throws
IOException if an error occurs while writing to the target stream.

write

Added in API level 1
void write (byte[] buffer)

Writes the entire contents of the byte array buffer to the output stream. Blocks until all bytes are written.

Parameters
buffer byte: the buffer to write.
Throws
IOException if an error occurs while writing to the target stream.

write

Added in API level 1
void write (int value)

Writes a single byte to the target stream. Only the least significant byte of the integer value is written to the stream. Blocks until the byte is actually written.

Parameters
value int: the byte to write.
Throws
IOException if an error occurs while writing to the target stream.

writeObject

Added in API level 1
void writeObject (Object obj)

Writes the specified object obj to the target stream.

Parameters
obj Object: the object to write.
Throws
IOException if an error occurs while writing to the target stream.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.