public interface ObjectOutput extends DataOutput, AutoCloseable
InputStream
,
ObjectOutputStream
,
ObjectInputStream
Modifier and Type | Method | Description |
---|---|---|
void |
close () |
Closes the stream.
|
void |
flush () |
Flushes the stream.
|
void |
write (byte[] b) |
Writes an array of bytes.
|
void |
write (byte[] b,
int off,
int len) |
Writes a sub array of bytes.
|
void |
write (int b) |
Writes a byte.
|
void |
writeObject (Object obj) |
Write an object to the underlying storage or stream.
|
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
void writeObject(Object obj) throws IOException
obj
- the object to be writtenIOException
- Any of the usual Input/Output related exceptions.void write(int b) throws IOException
write
in interface DataOutput
b
- the byteIOException
- If an I/O error has occurred.void write(byte[] b) throws IOException
write
in interface DataOutput
b
- the data to be writtenIOException
- If an I/O error has occurred.void write(byte[] b, int off, int len) throws IOException
write
in interface DataOutput
b
- the data to be writtenoff
- the start offset in the datalen
- the number of bytes that are writtenIOException
- If an I/O error has occurred.void flush() throws IOException
IOException
- If an I/O error has occurred.void close() throws IOException
close
in interface AutoCloseable
IOException
- If an I/O error has occurred. Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
Scripting on this page tracks web page traffic, but does not change the content in any way.