Class RateLimitedOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.apache.accumulo.core.file.streams.RateLimitedOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,PositionedOutput
public class RateLimitedOutputStream extends FilterOutputStream implements PositionedOutput
A decorator forOutputStream
which limits the rate at which data may be written.
-
-
Field Summary
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description RateLimitedOutputStream(OutputStream wrappedStream, RateLimiter writeLimiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
long
position()
void
write(byte[] buffer, int offset, int length)
void
write(int i)
-
Methods inherited from class java.io.FilterOutputStream
flush, write
-
-
-
-
Constructor Detail
-
RateLimitedOutputStream
public RateLimitedOutputStream(OutputStream wrappedStream, RateLimiter writeLimiter)
-
-
Method Detail
-
write
public void write(int i) throws IOException
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
public void write(byte[] buffer, int offset, int length) throws IOException
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
position
public long position() throws IOException
- Specified by:
position
in interfacePositionedOutput
- Throws:
IOException
-
-