AutoCloseable
, DataInput
ObjectInputStream
public interface ObjectInput extends DataInput, AutoCloseable
Modifier and Type | Method | Description |
---|---|---|
int |
available() |
Returns the number of bytes that can be read without blocking. |
void |
close() |
Closes the input stream. |
int |
read() |
Reads a byte of data. |
int |
read |
Reads into an array of bytes. |
int |
read |
Reads into an array of bytes. |
Object |
readObject() |
Read and return an object. |
long |
skip |
Skips n bytes of input. |
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
Object readObject() throws ClassNotFoundException, IOException
ClassNotFoundException
- If the class of a serialized object cannot be found.IOException
- If any of the usual Input/Output related exceptions occur.int read() throws IOException
IOException
- If an I/O error has occurred.int read(byte[] b) throws IOException
b
- the buffer into which the data is read-1
if there is no more data because the end of the stream has been reached.IOException
- If an I/O error has occurred.int read(byte[] b, int off, int len) throws IOException
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read-1
if there is no more data because the end of the stream has been reached.IOException
- If an I/O error has occurred.IndexOutOfBoundsException
- If off
is negative, len
is negative, or len
is greater than b.length - off
long skip(long n) throws IOException
n
- the number of bytes to be skippedIOException
- If an I/O error has occurred.int available() throws IOException
IOException
- If an I/O error has occurred.void close() throws IOException
close
in interface AutoCloseable
IOException
- If an I/O error has occurred.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/ObjectInput.html