public interface ObjectInput extends DataInput, AutoCloseable
InputStream
,
ObjectOutputStream
,
ObjectInputStream
Modifier and Type | Method and 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(byte[] b)
Reads into an array of bytes.
|
int |
read(byte[] b,
int off,
int len)
Reads into an array of bytes.
|
Object |
readObject()
Read and return an object.
|
long |
skip(long n)
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 readIOException
- 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 readIOException
- If an I/O error has occurred.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. Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2016, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.