public interface ObjectOutput extends DataOutput, AutoCloseable
ObjectOutputStream,
ObjectInput| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the target stream.
|
void |
flush()
Flushes the target stream.
|
void |
write(byte[] buffer)
Writes the entire contents of the byte array
buffer to the output
stream. |
void |
write(byte[] buffer,
int offset,
int count)
Writes
count bytes from the byte array buffer starting at
position offset to the target stream. |
void |
write(int value)
Writes a single byte to the target stream.
|
void |
writeObject(Object obj)
Writes the specified object
obj to the target stream. |
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFvoid close()
throws IOException
close in interface AutoCloseableIOException - if an error occurs while closing the target stream.void flush()
throws IOException
IOException - if an error occurs while flushing the target stream.void write(byte[] buffer)
throws IOException
buffer to the output
stream. Blocks until all bytes are written.write in interface DataOutputbuffer - the buffer to write.IOException - if an error occurs while writing to the target stream.void write(byte[] buffer,
int offset,
int count)
throws IOException
count bytes from the byte array buffer starting at
position offset to the target stream. Blocks until all bytes are
written.write in interface DataOutputbuffer - the buffer to write.offset - the index of the first byte in buffer to write.count - the number of bytes from buffer to write to the target
stream.IOException - if an error occurs while writing to the target stream.void write(int value)
throws IOException
value is written to the stream. Blocks until
the byte is actually written.write in interface DataOutputvalue - the byte to write.IOException - if an error occurs while writing to the target stream.DataInput.readByte()void writeObject(Object obj) throws IOException
obj to the target stream.obj - the object to write.IOException - if an error occurs while writing to the target stream.