|
Oracle | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.compoze.util.MeteredInputStream
public class MeteredInputStream
This class provides a FilterInputStream
that performs several
testing/monitoring functions:
Nested Class Summary | |
---|---|
static class |
MeteredInputStream.RandomInputStream
A NullInputStream for testing purposes. |
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
MeteredInputStream(java.io.InputStream in)
Constructor. |
|
MeteredInputStream(java.io.InputStream in,
boolean bCalculateChecksum)
Constructor. |
|
MeteredInputStream(java.io.InputStream in,
int iMaxBytesPerSecond,
boolean bCalculateChecksum)
Constructor. |
Method Summary | |
---|---|
void |
close()
Closes the InputStream . |
int |
getAverageWriteLength()
Gets the average write length that has been issued. |
double |
getBytesPerSecond()
Gets the number of bytes per second that have been read since the InputStream was instantiated. |
long |
getBytesRead()
Gets the number of bytes that have been read so far. |
long |
getChecksum()
Gets a checksum of all of the data that has been read. |
static void |
main(java.lang.String[] args)
Main. |
int |
read()
Writes a single byte. |
int |
read(byte[] b)
Reads a byte array. |
int |
read(byte[] b,
int iOffset,
int iLength)
Reads a byte array. |
java.lang.String |
toString()
Creates a string representation of the output stream. |
Methods inherited from class java.io.FilterInputStream |
---|
available, mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MeteredInputStream(java.io.InputStream in)
public MeteredInputStream(java.io.InputStream in, boolean bCalculateChecksum)
public MeteredInputStream(java.io.InputStream in, int iMaxBytesPerSecond, boolean bCalculateChecksum)
Method Detail |
---|
public void close() throws java.io.IOException
InputStream
.
close
in interface java.io.Closeable
close
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b, int iOffset, int iLength) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public long getBytesRead()
public int getAverageWriteLength()
public double getBytesPerSecond()
InputStream
was instantiated.
public long getChecksum()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
Oracle | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |