- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- すべての実装されたインタフェース:
Closeable,Flushable,Appendable,AutoCloseable
public abstract class FilterWriter extends Writer
フィルタ処理された文字ストリームのための抽象クラスです。 抽象クラスFilterWriterそのものが、格納されているストリームにすべての要求を渡すデフォルトのメソッドを提供します。FilterWriterのサブクラスは、これらのメソッドの一部をオーバーライドし、追加のメソッドやフィールドを提供することもできます。- 導入されたバージョン:
- 1.1
-
-
コンストラクタのサマリー
コンストラクタ 修飾子 コンストラクタ 説明 protectedFilterWriter(Writer out)フィルタ処理された新しいライターを作成します。
-
メソッドのサマリー
すべてのメソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 voidclose()ストリームを最初にフラッシュして、閉じます。voidflush()ストリームをフラッシュします。voidwrite(char[] cbuf, int off, int len)文字の配列の一部を書き込みます。voidwrite(int c)単一の文字を書き込みます。voidwrite(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- 入出力エラーが発生した場合
-
close
public void close() throws IOException次のクラスからコピーされた説明:Writerストリームを最初にフラッシュして、閉じます。 ストリームが閉じられたあとにwrite()またはflush()を呼び出すと、IOExceptionがスローされます。 すでに閉じられているストリームを閉じても、何の影響もありません。- 定義:
close、インタフェース:AutoCloseable- 定義:
close、インタフェース:Closeable- 定義:
close、クラス:Writer- 例外:
IOException- 入出力エラーが発生した場合
-
-