public class BufferedByteCountOutputStream
extends java.io.BufferedOutputStream
Constructor and Description |
---|
BufferedByteCountOutputStream(java.io.OutputStream out)
Create a new instance with a default buffer size.
|
BufferedByteCountOutputStream(java.io.OutputStream out,
int size)
Create a new instance with a specific buffer size.
|
Modifier and Type | Method and Description |
---|---|
long |
getNumberOfWrittenBytes()
Get the number of written bytes.
|
void |
resetNumberOfWrittenBytes()
Reset the number of written bytes to zero.
|
void |
setCallbackInterface(BufferedByteCountOutputStreamCallbackInterface callbackInterface)
Set or unset the callback interface.
|
void |
write(byte[] b)
Writes a byte array to this output stream.
|
void |
write(byte[] b,
int off,
int len)
Writes len bytes from a byte array starting at offset off to this output stream.
|
void |
write(int b)
Writes a byte to this output stream.
|
public BufferedByteCountOutputStream(java.io.OutputStream out)
out
- the underlying output streampublic BufferedByteCountOutputStream(java.io.OutputStream out, int size)
out
- the underlying output streamsize
- the buffer sizepublic void setCallbackInterface(BufferedByteCountOutputStreamCallbackInterface callbackInterface)
callbackInterface
- the callback interface to set, or null to unset the callback interfacepublic void write(int b) throws java.io.IOException
write
in class java.io.BufferedOutputStream
b
- the bytejava.io.IOException
- if an I/O error occurspublic void write(byte[] b) throws java.io.IOException
write
in class java.io.FilterOutputStream
b
- the data to be writtenjava.io.IOException
- if an I/O error occurspublic void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.BufferedOutputStream
b
- the dataoff
- the start offset in the datalen
- the number of bytes to writejava.io.IOException
- if an I/O error occurspublic long getNumberOfWrittenBytes()
public void resetNumberOfWrittenBytes()