AutoCloseable
, DataOutput
ObjectOutputStream
public interface ObjectOutput extends DataOutput, AutoCloseable
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Closes the stream. |
void |
flush() |
Flushes the stream. |
void |
write |
Writes an array of bytes. |
void |
write |
Writes a sub array of bytes. |
void |
write |
Writes a byte. |
void |
writeObject |
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.IndexOutOfBoundsException
- If off
is negative, len
is negative, or len
is greater than b.length - off
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.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/ObjectOutput.html