Package com.linkedin.alpini.io
Class MeteredOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.linkedin.alpini.io.MeteredOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class MeteredOutputStream extends java.io.FilterOutputStream
-
-
Constructor Summary
Constructors Constructor Description MeteredOutputStream(java.io.OutputStream out)Creates an output stream filter built on top of the specified underlying output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetBytesWritten()voidwrite(byte[] b)Writesb.lengthbytes to this output stream.voidwrite(byte[] b, int off, int len)Writeslenbytes from the specifiedbytearray starting at offsetoffto this output stream.voidwrite(int b)Writes the specifiedbyteto this output stream.
-
-
-
Method Detail
-
getBytesWritten
public long getBytesWritten()
-
write
public void write(int b) throws java.io.IOExceptionWrites the specifiedbyteto this output stream.- Overrides:
writein classjava.io.FilterOutputStream- Parameters:
b- thebyte.- Throws:
java.io.IOException- if an I/O error occurs.
-
write
public void write(@Nonnull byte[] b) throws java.io.IOExceptionWritesb.lengthbytes to this output stream.- Overrides:
writein classjava.io.FilterOutputStream- Parameters:
b- the data to be written.- Throws:
java.io.IOException- if an I/O error occurs.
-
write
public void write(@Nonnull byte[] b, int off, int len) throws java.io.IOExceptionWriteslenbytes from the specifiedbytearray starting at offsetoffto this output stream.- Overrides:
writein classjava.io.FilterOutputStream- Parameters:
b- the data.off- the start offset in the data.len- the number of bytes to write.- Throws:
java.io.IOException- if an I/O error occurs.
-
-