public final class ObjectInputStream extends java.io.InputStream implements IObjectInput
| Constructor and Description |
|---|
ObjectInputStream(java.io.InputStream stream)
Creates a new ObjectInputStream that uses the passed DataInputStream
to read from.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying DataInputStream.
|
int |
read()
Reads a byte from the underlying DataInputStream.
|
boolean |
readBoolean()
Reads a boolean.
|
byte |
readByte()
Reads a byte.
|
void |
readBytes(byte[] buffer)
Reads a number of bytes and writes them into the buffer.
|
void |
readBytes(byte[] buffer,
int offset,
int length)
Reads a number of bytes and writes them into the buffer
starting from the specified offset.
|
char |
readChar()
Reads a char.
|
int |
readInt()
Reads a 32 bit integer.
|
long |
readLong()
Reads a 64 bit integer.
|
java.lang.Object |
readObject()
Reads an object from the underlying DataInputStream.
|
short |
readShort()
Reads a 16 bit integer.
|
java.lang.String |
readUTF()
Reads a utf encoded string.
|
public ObjectInputStream(java.io.InputStream stream)
stream - The DataInputStream to read from.public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException - Thrown if the underlying stream throws an
exception.public java.lang.Object readObject()
throws java.io.IOException
readObject in interface IObjectInputjava.io.IOException - Thrown if the object could not be read.public boolean readBoolean()
throws java.io.IOException
readBoolean in interface IObjectInputjava.io.IOException - Thrown if a problem occurs.public char readChar()
throws java.io.IOException
readChar in interface IObjectInputjava.io.IOException - Thrown if a problem occurs.public int readInt()
throws java.io.IOException
readInt in interface IObjectInputjava.io.IOException - Thrown if a problem occurs.public long readLong()
throws java.io.IOException
readLong in interface IObjectInputjava.io.IOException - Thrown if a problem occurs.public short readShort()
throws java.io.IOException
readShort in interface IObjectInputjava.io.IOException - Thrown if a problem occurs.public java.lang.String readUTF()
throws java.io.IOException
readUTF in interface IObjectInputjava.io.IOException - Thrown if a problem occurs.public byte readByte()
throws java.io.IOException
readByte in interface IObjectInputjava.io.IOException - Thrown if a problem occurs.public void readBytes(byte[] buffer)
throws java.io.IOException
readBytes in interface IObjectInputbuffer - The buffer to fill.java.io.IOException - Thrown if a problem occurs.public void readBytes(byte[] buffer,
int offset,
int length)
throws java.io.IOException
readBytes in interface IObjectInputbuffer - The buffer to fill.offset - The offset to start from.length - The number of bytes to fill.java.io.IOException - Thrown if a problem occurs.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOException - Thrown if closing the underlying stream caused an
exception.