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 long
getBytesWritten()
void
write(byte[] b)
Writesb.length
bytes to this output stream.void
write(byte[] b, int off, int len)
Writeslen
bytes from the specifiedbyte
array starting at offsetoff
to this output stream.void
write(int b)
Writes the specifiedbyte
to this output stream.
-
-
-
Method Detail
-
getBytesWritten
public long getBytesWritten()
-
write
public void write(int b) throws java.io.IOException
Writes the specifiedbyte
to this output stream.- Overrides:
write
in 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.IOException
Writesb.length
bytes to this output stream.- Overrides:
write
in 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.IOException
Writeslen
bytes from the specifiedbyte
array starting at offsetoff
to this output stream.- Overrides:
write
in 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.
-
-