- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- すべての実装されたインタフェース:
Closeable
,Flushable
,Appendable
,AutoCloseable
public abstract class FilterWriter extends Writer
フィルタ処理された文字ストリームのための抽象クラスです。 抽象クラスFilterWriter
そのものが、格納されているストリームにすべての要求を渡すデフォルトのメソッドを提供します。FilterWriter
のサブクラスは、これらのメソッドの一部をオーバーライドし、追加のメソッドやフィールドを提供することもできます。- 導入されたバージョン:
- 1.1
-
-
コンストラクタのサマリー
コンストラクタ 修飾子 コンストラクタ 説明 protected
FilterWriter(Writer out)
フィルタ処理された新しいライターを作成します。
-
メソッドのサマリー
すべてのメソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 void
flush()
ストリームをフラッシュします。void
write(char[] cbuf, int off, int len)
文字の配列の一部を書き込みます。void
write(int c)
単一の文字を書き込みます。void
write(String str, int off, int len)
文字列の一部を書き込みます。
-
-
-
フィールドの詳細
-
out
protected Writer out
ベースとなる文字出力ストリームです。
-
-
コンストラクタの詳細
-
FilterWriter
protected FilterWriter(Writer out)
フィルタ処理された新しいライターを作成します。- パラメータ:
out
- ベースとなるストリームを提供するWriterオブジェクト。- 例外:
NullPointerException
-out
がnull
である場合
-
-
メソッドの詳細
-
write
public void write(int c) throws IOException
単一の文字を書き込みます。- オーバーライド:
write
、クラス:Writer
- パラメータ:
c
- 書き込まれる文字を指定するint- 例外:
IOException
- 入出力エラーが発生した場合
-
write
public void write(char[] cbuf, int off, int len) throws IOException
文字の配列の一部を書き込みます。- 定義:
write
、クラス:Writer
- パラメータ:
cbuf
- 書き込む文字のバッファoff
- 文字の読込み開始オフセットlen
- 書き込む文字数- 例外:
IndexOutOfBoundsException
-off
およびlen
パラメータの値によって、下にあるWriter
の対応するメソッドがIndexOutOfBoundsException
をスローする場合IOException
- 入出力エラーが発生した場合
-
write
public void write(String str, int off, int len) throws IOException
文字列の一部を書き込みます。- オーバーライド:
write
、クラス:Writer
- パラメータ:
str
- 書き込まれる文字列off
- 文字の読込み開始オフセットlen
- 書き込む文字数- 例外:
IndexOutOfBoundsException
-off
およびlen
パラメータの値によって、下にあるWriter
の対応するメソッドがIndexOutOfBoundsException
をスローする場合IOException
- 入出力エラーが発生した場合
-
flush
public void flush() throws IOException
ストリームをフラッシュします。- 定義:
flush
、インタフェース:Flushable
- 定義:
flush
、クラス:Writer
- 例外:
IOException
- 入出力エラーが発生した場合
-
-