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.OutputStreami - 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.Flushableflush in class java.io.OutputStreamjava.io.IOException - Thrown if the underlying stream throws an
exception.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOException - Thrown if the underlying stream throws an
exception.public void writeObject(java.lang.Object object)
throws java.io.IOException
writeObject in interface IObjectOutputobject - 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 IObjectOutputval - the boolean value to writejava.io.IOException - Thrown if an problem occurs.public void writeChar(char val)
throws java.io.IOException
writeChar in interface IObjectOutputval - The character to be writtenjava.io.IOException - Thrown if an problem occurs.public void writeInt(int val)
throws java.io.IOException
writeInt in interface IObjectOutputval - 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 IObjectOutputval - The 64-bit integer.java.io.IOException - Thrown if an problem occurs.public void writeShort(int val)
throws java.io.IOException
writeShort in interface IObjectOutputval - 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 IObjectOutputval - 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 IObjectOutputval - The byte value to writejava.io.IOException - Thrown if an problem occurs.public void writeBytes(byte[] buffer)
throws java.io.IOException
writeBytes in interface IObjectOutputbuffer - 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 IObjectOutputbuffer - 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.