|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
org.jaudiotagger.audio.asf.io.CountingOutputstream
public class CountingOutputstream
This output stream wraps around another OutputStream and delegates
the write calls.
Additionally all written bytes are counted and available by
getCount().
| Field Summary | |
|---|---|
private long |
count
Stores the amount of bytes written. |
private java.io.OutputStream |
wrapped
The stream to forward the write calls. |
| Constructor Summary | |
|---|---|
CountingOutputstream(java.io.OutputStream outputStream)
Creates an instance which will delegate the write calls to the given output stream. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
flush()
|
long |
getCount()
|
void |
write(byte[] bytes)
|
void |
write(byte[] bytes,
int off,
int len)
|
void |
write(int toWrite)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private long count
private final java.io.OutputStream wrapped
| Constructor Detail |
|---|
public CountingOutputstream(java.io.OutputStream outputStream)
outputStream - stream to wrap.| Method Detail |
|---|
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic long getCount()
public void write(byte[] bytes)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(byte[] bytes,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(int toWrite)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||