|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
com.gc.iotools.stream.os.StatsOutputStream
public class StatsOutputStream
Gather some statistics on the OutputStream passed in the
constructor.
It can be used to read:
Full statistics are available after the stream has been fully processed (by other parts of the application), or after invoking the method close() while partial statistics are available on the fly.
| Constructor Summary | |
|---|---|
StatsOutputStream(OutputStream destination)
Creates a new SizeRecorderOutputStream with the given
destination stream. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
flush()
|
String |
getBitRateString()
Returns the writing bit rate formatted with a convenient unit. |
long |
getSize()
Returns the number of bytes written until now. |
long |
getTime(TimeUnit tu)
Returns the time spent until now waiting for the internal stream to write the data. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StatsOutputStream(OutputStream destination)
SizeRecorderOutputStream with the given
destination stream.
destination - Destination stream where data are written.| Method Detail |
|---|
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOException
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic long getSize()
public String getBitRateString()
public long getTime(TimeUnit tu)
Returns the time spent until now waiting for the internal stream to write the data.
tu - Unit to measure the time.
public void write(byte[] b)
throws IOException
write in class OutputStreamIOException
public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOException
public void write(int b)
throws IOException
write in class OutputStreamIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||