Package com.streamconverter.util
Class MeasuredInputStream
java.lang.Object
java.io.InputStream
com.streamconverter.util.MeasuredInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
入力ストリームのデータサイズを測定するラッパークラス
このクラスは、InputStreamをラップして読み取ったバイト数を自動的に計測します。 自動ログ出力機能でパフォーマンス測定に使用されます。
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
MeasuredInputStream
コンストラクタ- Parameters:
delegateStream
- ラップ対象のInputStream
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
mark
- Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
- Overrides:
markSupported
in classInputStream
-
getBytesRead
現在までに読み取ったバイト数を取得- Returns:
- 読み取ったバイト数
-
isClosed
ストリームがクローズされているかどうかを確認- Returns:
- クローズされている場合true
-