public final class ObjectOutputStream extends java.io.OutputStream implements IObjectOutput
Modifier and Type | Field and Description |
---|---|
static int |
MAXIMUM_LENGTH
The maximum length for writing strings.
|
Constructor and Description |
---|
ObjectOutputStream(java.io.OutputStream stream)
Creates a new ObjectOutputStream that writes to the specified
DataOutputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying stream.
|
void |
flush()
Flushes the underlying stream.
|
void |
write(int i)
Writes an integer to the underlying output stream.
|
void |
writeBoolean(boolean val)
Writes a boolean.
|
void |
writeByte(byte val)
Writes a 8-bit byte.
|
void |
writeBytes(byte[] buffer)
Writes a number of bytes from the byte array buffer.
|
void |
writeBytes(byte[] buffer,
int offset,
int length)
Writes a number of bytes from the byte array buffer starting at
the offset index.
|
void |
writeChar(char val)
Writes the specified 16-bit character.
|
void |
writeInt(int val)
Writes a 32-bit integer.
|
void |
writeLong(long val)
Writes a 64-bit integer.
|
void |
writeObject(java.lang.Object object)
Writes the passed object to the underlying DataOutputStream and
performs the necessary buffer management.
|
void |
writeShort(int val)
Writes the specified 16-bit integer.
|
void |
writeUTF(java.lang.String val)
Writes the specified String out in UTF format.
|
public static final int MAXIMUM_LENGTH
public ObjectOutputStream(java.io.OutputStream stream)
stream
- The DataOutputStream to write to.public void write(int i) throws java.io.IOException
write
in class java.io.OutputStream
i
- The integer to write.java.io.IOException
- Thrown if the underlying stream throws an
exception.public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- Thrown if the underlying stream throws an
exception.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
- Thrown if the underlying stream throws an
exception.public void writeObject(java.lang.Object object) throws java.io.IOException
writeObject
in interface IObjectOutput
object
- The object to write.java.io.IOException
- Thrown if an exception occurs while writing
the object.public void writeBoolean(boolean val) throws java.io.IOException
writeBoolean
in interface IObjectOutput
val
- the boolean value to writejava.io.IOException
- Thrown if an problem occurs.public void writeChar(char val) throws java.io.IOException
writeChar
in interface IObjectOutput
val
- The character to be writtenjava.io.IOException
- Thrown if an problem occurs.public void writeInt(int val) throws java.io.IOException
writeInt
in interface IObjectOutput
val
- The integer to be written.java.io.IOException
- Thrown if an problem occurs.public void writeLong(long val) throws java.io.IOException
writeLong
in interface IObjectOutput
val
- The 64-bit integer.java.io.IOException
- Thrown if an problem occurs.public void writeShort(int val) throws java.io.IOException
writeShort
in interface IObjectOutput
val
- The 16-bit integer to be written.java.io.IOException
- Thrown if an problem occurs.public void writeUTF(java.lang.String val) throws java.io.IOException
writeUTF
in interface IObjectOutput
val
- The String to be written in UTF format.java.io.IOException
- Thrown if an problem occurs.public void writeByte(byte val) throws java.io.IOException
writeByte
in interface IObjectOutput
val
- The byte value to writejava.io.IOException
- Thrown if an problem occurs.public void writeBytes(byte[] buffer) throws java.io.IOException
writeBytes
in interface IObjectOutput
buffer
- The buffer to be writtenjava.io.IOException
- Thrown if an problem occurs.public void writeBytes(byte[] buffer, int offset, int length) throws java.io.IOException
writeBytes
in interface IObjectOutput
buffer
- The buffer to be written.offset
- The offset in buffer.length
- The number of bytes to write.java.io.IOException
- Thrown if an problem occurs.