|
|||||||||
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(java.io.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(java.io.InputStream base)
base
- the InputStreamMethod Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- If an I/O error has occurred.public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
b
- the buffer into which the data is read
java.io.IOException
- If an I/O error has occurred.public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
java.io.IOException
- If an I/O error has occurred.public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
n
- the number of bytes to be skipped
java.io.IOException
- If an I/O error has occurred.public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
- If an I/O error has occurred.public void mark(int readlimit)
mark
in class java.io.InputStream
readlimit
- the maximum limit of bytes allowed to be read
before the mark position becomes invalid.public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
- If the stream has not been marked or
if the mark has been invalidated.public boolean markSupported()
markSupported
in class java.io.InputStream
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |