Package org.apache.james.jdkim.canon
Class LimitedOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.james.jdkim.canon.LimitedOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Pass data to the underlying system until a given amount of bytes is reached.
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.FilterOutputStream
close, flush, writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
LimitedOutputStream
- Parameters:
out- an output stream that will receive the "trucated" stream.limit- a positive integer of the number of bytes to be passed to the underlying stream
-
-
Method Details
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
getComputedBytes
public int getComputedBytes()- Returns:
- the number of bytes passed to the underlying stream
-
isLimited
public boolean isLimited()- Returns:
- true if the limit has been reached and no data is being passed to the underlying stream.
-