Package net.i2p.i2ptunnel.util
Class ByteLimitOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
net.i2p.i2ptunnel.util.LimitOutputStream
net.i2p.i2ptunnel.util.ByteLimitOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
An OutputStream that limits how many bytes are written
- Since:
- 0.9.62
-
Nested Class Summary
Nested classes/interfaces inherited from class net.i2p.i2ptunnel.util.LimitOutputStream
LimitOutputStream.DoneCallback
-
Field Summary
Fields inherited from class net.i2p.i2ptunnel.util.LimitOutputStream
_callback, _isDone
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorDescriptionByteLimitOutputStream
(OutputStream out, LimitOutputStream.DoneCallback done, long limit) -
Method Summary
Modifier and TypeMethodDescriptionvoid
write
(byte[] src, int off, int len) Subclasses MUST override the following method such that it calls done() when finished and throws EOFException if called againMethods inherited from class net.i2p.i2ptunnel.util.LimitOutputStream
isDone, setDone, write
Methods inherited from class java.io.FilterOutputStream
close, flush, write
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ByteLimitOutputStream
- Parameters:
limit
- greater than zero
-
-
Method Details
-
write
Description copied from class:LimitOutputStream
Subclasses MUST override the following method such that it calls done() when finished and throws EOFException if called again- Overrides:
write
in classLimitOutputStream
- Throws:
IOException
-