public class MonitorInputStream extends BufferedInputStream
in
Constructor and Description |
---|
MonitorInputStream(InputStream in)
Constructs a MonitorInputStream from the passed InputStream
|
MonitorInputStream(InputStream in,
int bufferSize)
Constructs a MonitorInputStream from the passed InputStream and with the specified buffer size
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns 0 if the stream is at EOF, else the underlying inputStream will be queried.
|
void |
close()
Closes this input stream and releases any system resources associated with the stream.
|
protected void |
closeSuper()
This method exists in order to allow overriding whether to actually close
the underlying stream (VFS-805).
|
long |
getCount()
Gets the number of bytes read by this input stream.
|
protected void |
onClose()
Called after the stream has been closed.
|
int |
read()
Reads a character.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads bytes from this input stream.
|
mark, markSupported, reset, skip
read
public MonitorInputStream(InputStream in)
in
- The input stream to wrap.public MonitorInputStream(InputStream in, int bufferSize)
in
- The input stream to wrap.bufferSize
- The buffer size to use.public int available() throws IOException
available
in class BufferedInputStream
IOException
- if an error occurs.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class BufferedInputStream
IOException
- if an error occurs.public long getCount()
protected void closeSuper() throws IOException
IOException
- if an IO error occurs.protected void onClose() throws IOException
IOException
- if an error occurs.public int read() throws IOException
read
in class BufferedInputStream
IOException
- if an IO error occurs.public int read(byte[] buffer, int offset, int length) throws IOException
read
in class BufferedInputStream
buffer
- A byte array in which to place the characters read.offset
- The offset at which to start reading.length
- The maximum number of bytes to read.IOException
- if an IO error occurs.Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.