public interface ObjectInput extends DataInput, AutoCloseable
ObjectInputStream,
ObjectOutput| Modifier and Type | Method and Description |
|---|---|
int |
available()
Indicates the number of bytes of primitive data that can be read without
blocking.
|
void |
close()
Closes this stream.
|
int |
read()
Reads a single byte from this stream and returns it as an integer in the
range from 0 to 255.
|
int |
read(byte[] buffer)
Reads bytes from this stream into the byte array
buffer. |
int |
read(byte[] buffer,
int byteOffset,
int byteCount)
Reads up to
byteCount bytes from this stream and stores them in
byte array buffer starting at offset byteOffset. |
Object |
readObject()
Reads the next object from this stream.
|
long |
skip(long byteCount)
Skips
byteCount bytes on this stream. |
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytesint available()
throws IOException
IOException - if an I/O error occurs.void close()
throws IOException
close in interface AutoCloseableIOException - if an I/O error occurs while closing the input stream.int read() throws IOException
IOException - if this stream is closed or another I/O error occurs.int read(byte[] buffer) throws IOException
buffer. Blocks
while waiting for input. Returns the number of bytes read,
or -1 if the end of this stream has been reached.IOException - if this stream is closed or another I/O error occurs.int read(byte[] buffer,
int byteOffset,
int byteCount)
throws IOException
byteCount bytes from this stream and stores them in
byte array buffer starting at offset byteOffset. Blocks while
waiting for input. Returns the number of bytes read or -1 if the end of this stream has been
reached.IOException - if this stream is closed or another I/O error occurs.Object readObject() throws ClassNotFoundException, IOException
ClassNotFoundException - if the object's class cannot be found.IOException - if this stream is closed or another I/O error occurs.long skip(long byteCount) throws IOException
byteCount bytes on this stream. Less than byteCount byte are
skipped if the end of this stream is reached before the operation
completes.IOException - if this stream is closed or another I/O error occurs.