Most visited

Recently visited

Added in API level 1

FilterWriter

public abstract class FilterWriter
extends Writer

java.lang.Object
   ↳ java.io.Writer
     ↳ java.io.FilterWriter


用于编写过滤字符流的抽象类。 抽象类FilterWriter本身提供了将所有请求传递到包含的流的默认方法。 FilterWriter子类应该重写其中一些方法,并且还可以提供其他方法和字段。

Summary

Fields

protected Writer out

底层的字符输出流。

Inherited fields

From class java.io.Writer

Protected constructors

FilterWriter(Writer out)

创建一个新的过滤作家。

Public methods

void close()

关闭小溪,首先冲洗它。

void flush()

刷新流。

void write(int c)

写一个字符。

void write(String str, int off, int len)

写入一部分字符串。

void write(char[] cbuf, int off, int len)

写入一个字符数组的一部分。

Inherited methods

From class java.io.Writer
From class java.lang.Object
From interface java.lang.Appendable
From interface java.io.Closeable
From interface java.io.Flushable
From interface java.lang.AutoCloseable

Fields

out

Added in API level 1
Writer out

底层的字符输出流。

Protected constructors

FilterWriter

Added in API level 1
FilterWriter (Writer out)

创建一个新的过滤作家。

Parameters
out Writer: a Writer object to provide the underlying stream.
Throws
NullPointerException if out is null

Public methods

close

Added in API level 1
void close ()

关闭小溪,首先冲洗它。 一旦流被关闭,进一步的write()或flush()调用将导致抛出IOException异常。 关闭以前关闭的流不起作用。

Throws
IOException

flush

Added in API level 1
void flush ()

刷新流。

Throws
IOException If an I/O error occurs

write

Added in API level 1
void write (int c)

写一个字符。

Parameters
c int: int specifying a character to be written
Throws
IOException If an I/O error occurs

write

Added in API level 1
void write (String str, 
                int off, 
                int len)

写入一部分字符串。

Parameters
str String: String to be written
off int: Offset from which to start reading characters
len int: Number of characters to be written
Throws
IOException If an I/O error occurs

write

Added in API level 1
void write (char[] cbuf, 
                int off, 
                int len)

写入一个字符数组的一部分。

Parameters
cbuf char: Buffer of characters to be written
off int: Offset from which to start reading characters
len int: Number of characters to be written
Throws
IOException If an I/O error occurs

Hooray!