public class BufferedIOStatisticsInputStream extends BufferedInputStream implements IOStatisticsSource, StreamCapabilities
BufferedInputStream
which implements
IOStatisticsSource
and forwards requests for the
IOStatistics
to the wrapped stream.
This should be used when any input stream needs buffering while
allowing the inner stream to be a source of statistics.
It also implements StreamCapabilities
and forwards the probe
to the inner stream, if possible.StreamCapabilities.StreamCapability
in
ABORTABLE_STREAM, DROPBEHIND, HFLUSH, HSYNC, IOSTATISTICS, PREADBYTEBUFFER, READAHEAD, READBYTEBUFFER, UNBUFFER
Constructor and Description |
---|
BufferedIOStatisticsInputStream(InputStream in)
Buffer an input stream with the default buffer size of 8k.
|
BufferedIOStatisticsInputStream(InputStream in,
int size)
Buffer an input stream with the chosen buffer size.
|
Modifier and Type | Method and Description |
---|---|
IOStatistics |
getIOStatistics()
Return any IOStatistics offered by the inner stream.
|
boolean |
hasCapability(String capability)
If the inner stream supports
StreamCapabilities ,
forward the probe to it. |
available, close, mark, markSupported, read, read, reset, skip
read
public BufferedIOStatisticsInputStream(InputStream in)
in
- input streampublic BufferedIOStatisticsInputStream(InputStream in, int size)
in
- input streamsize
- buffer sizepublic IOStatistics getIOStatistics()
getIOStatistics
in interface IOStatisticsSource
public boolean hasCapability(String capability)
StreamCapabilities
,
forward the probe to it.
Otherwise: return false.hasCapability
in interface StreamCapabilities
capability
- string to query the stream support for.Copyright © 2008–2021 Apache Software Foundation. All rights reserved.