Most visited

Recently visited

Added in API level 1

ObjectOutput

public interface ObjectOutput
implements DataOutput, AutoCloseable

java.io.ObjectOutput
Known Indirect Subclasses


ObjectOutput扩展了DataOutput接口以包含对象的写入。 DataOutput包括用于输出基本类型的方法,ObjectOutput扩展了该接口以包含对象,数组和字符串。

也可以看看:

Summary

Public methods

abstract void close()

关闭流。

abstract void flush()

刷新流。

abstract void write(byte[] b)

写入一个字节数组。

abstract void write(byte[] b, int off, int len)

写入一个字节的子数组。

abstract void write(int b)

写一个字节。

abstract void writeObject(Object obj)

将对象写入底层存储或流。

Inherited methods

From interface java.io.DataOutput
From interface java.lang.AutoCloseable

Public methods

close

Added in API level 1
void close ()

关闭流。 必须调用此方法才能释放与流关联的所有资源。

Throws
IOException If an I/O error has occurred.

flush

Added in API level 1
void flush ()

刷新流。 这将写入任何缓冲的输出字节。

Throws
IOException If an I/O error has occurred.

write

Added in API level 1
void write (byte[] b)

写入一个字节数组。 该方法将阻塞,直到字节被实际写入。

Parameters
b byte: the data to be written
Throws
IOException If an I/O error has occurred.

write

Added in API level 1
void write (byte[] b, 
                int off, 
                int len)

写入一个字节的子数组。

Parameters
b byte: the data to be written
off int: the start offset in the data
len int: the number of bytes that are written
Throws
IOException If an I/O error has occurred.

write

Added in API level 1
void write (int b)

写一个字节。 该方法将阻塞,直到字节被实际写入。

Parameters
b int: the byte
Throws
IOException If an I/O error has occurred.

writeObject

Added in API level 1
void writeObject (Object obj)

将对象写入底层存储或流。 实现此接口的类定义了如何写入对象。

Parameters
obj Object: the object to be written
Throws
IOException Any of the usual Input/Output related exceptions.

Hooray!