public final class MeteredStream extends OutputStream
Constructor and Description |
---|
MeteredStream(OutputStream out,
long written)
Create the stream wrapped around the specified output
stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the output stream which closes the target output stream.
|
void |
flush()
Flush the output stream which flushes the target output stream.
|
long |
getBytesWritten()
Returns the number of bytes written in this stream.
|
void |
write(byte[] buff) |
void |
write(byte[] buff,
int off,
int len) |
void |
write(int b) |
public MeteredStream(OutputStream out, long written)
out
- The target output stream to keep track of.written
- The number of bytes written to the stream.public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] buff) throws IOException
write
in class OutputStream
IOException
public void write(byte[] buff, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
- if the flush failed.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
- if the close failed.public long getBytesWritten()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.