FilterWriter
public abstract class FilterWriter
extends Writer
用于编写过滤字符流的抽象类。 抽象类FilterWriter
本身提供了将所有请求传递到包含的流的默认方法。 FilterWriter
子类应该重写其中一些方法,并且还可以提供其他方法和字段。
Summary
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) 写入一个字符数组的一部分。 |
Fields
Protected constructors
FilterWriter
FilterWriter (Writer out)
创建一个新的过滤作家。
Parameters |
out |
Writer : a Writer object to provide the underlying stream. |
Public methods
close
void close ()
关闭小溪,首先冲洗它。 一旦流被关闭,进一步的write()或flush()调用将导致抛出IOException异常。 关闭以前关闭的流不起作用。
write
void write (int c)
写一个字符。
Parameters |
c |
int : int specifying a character to be written |
write
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 |
write
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 |