public interface ObjectInput extends DataInput, AutoCloseable
InputStream , ObjectOutputStream , ObjectInputStream
| Modifier and Type | Method and Description |
|---|---|
int |
available()
返回可以读取而不阻塞的字节数。
|
void |
close()
关闭输入流。
|
int |
read()
读取一个字节的数据。
|
int |
read(byte[] b)
读入一个字节数组。
|
int |
read(byte[] b, int off, int len)
读入一个字节数组。
|
Object |
readObject()
读取并返回一个对象。
|
long |
skip(long n)
跳过n个字节的输入。
|
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytesObject readObject() throws ClassNotFoundException, IOException
ClassNotFoundException - 如果无法找到序列化对象的类。
IOException - 如果发生任何常见的输入/输出相关异常。
int read() throws IOException
IOException - 如果发生I / O错误。
int read(byte[] b) throws IOException
b - 读取数据的缓冲区
IOException - 如果发生I / O错误。
int read(byte[] b,
int off,
int len)
throws IOException
b - 读取数据的缓冲区
off - 数据的起始偏移量
len - 读取的最大字节数
IOException - 如果发生I / O错误。
long skip(long n) throws IOException
n - 要跳过的字节数
IOException - 如果发生I / O错误。
int available()
throws IOException
IOException - 如果发生I / O错误。
void close()
throws IOException
close在界面
AutoCloseable
IOException - 如果发生I / O错误。
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, 2014, Oracle and/or its affiliates. All rights reserved.