|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
ariba.util.io.StatsInputStream
public class StatsInputStream
StatsInputStream is an InputStream that keeps track of the number of bytes that have been read in. @see InputStream
| Field Summary | |
|---|---|
long |
count
Number of bytes read. |
| Constructor Summary | |
|---|---|
StatsInputStream(InputStream base)
Creates a StatsInputStream. |
|
| Method Summary | |
|---|---|
int |
available()
Returns the number of bytes that can be read without blocking. |
void |
close()
Closes the input stream. |
void |
mark(int readlimit)
Marks the current position in the input stream. |
boolean |
markSupported()
Returns a boolean indicating whether or not this stream type supports mark/reset. |
int |
read()
Reads a byte of data. |
int |
read(byte[] b)
Reads into an array of bytes. |
int |
read(byte[] b,
int off,
int len)
Reads into an array of bytes. |
void |
reset()
Repositions the stream to the last marked position. |
long |
skip(long n)
Skips n bytes of input. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public long count
| Constructor Detail |
|---|
public StatsInputStream(InputStream base)
base - the InputStream| Method Detail |
|---|
public int read()
throws IOException
read in class InputStreamIOException - If an I/O error has occurred.
public int read(byte[] b)
throws IOException
read in class InputStreamb - the buffer into which the data is read
IOException - If an I/O error has occurred.
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamb - the buffer into which the data is readoff - the start offset of the datalen - the maximum number of bytes read
IOException - If an I/O error has occurred.
public long skip(long n)
throws IOException
skip in class InputStreamn - the number of bytes to be skipped
IOException - If an I/O error has occurred.
public int available()
throws IOException
available in class InputStreamIOException
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException - If an I/O error has occurred.public void mark(int readlimit)
mark in class InputStreamreadlimit - the maximum limit of bytes allowed to be read
before the mark position becomes invalid.
public void reset()
throws IOException
reset in class InputStreamIOException - If the stream has not been marked or
if the mark has been invalidated.public boolean markSupported()
markSupported in class InputStream
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||