Package com.streamconverter.util
Class MeasuredOutputStream
java.lang.Object
java.io.OutputStream
com.streamconverter.util.MeasuredOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
出力ストリームのデータサイズを測定するラッパークラス
このクラスは、OutputStreamをラップして書き込んだバイト数を自動的に計測します。 自動ログ出力機能でパフォーマンス測定に使用されます。
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
MeasuredOutputStream
コンストラクタ- Parameters:
delegateStream
- ラップ対象のOutputStream
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
getBytesWritten
現在までに書き込んだバイト数を取得- Returns:
- 書き込んだバイト数
-
isClosed
ストリームがクローズされているかどうかを確認- Returns:
- クローズされている場合true
-