Package org.bouncycastle.util.io
Class BufferingOutputStream
java.lang.Object
java.io.OutputStream
org.bouncycastle.util.io.BufferingOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
An output stream that buffers data to be feed into an encapsulated output stream.
The stream zeroes out the internal buffer on each flush.
-
Constructor Summary
ConstructorDescriptionCreate a buffering stream with the default buffer size (4096).BufferingOutputStream
(OutputStream other, int bufferSize) Create a buffering stream with a specified buffer size. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
BufferingOutputStream
Create a buffering stream with the default buffer size (4096).- Parameters:
other
- output stream to be wrapped.
-
BufferingOutputStream
Create a buffering stream with a specified buffer size.- Parameters:
other
- output stream to be wrapped.bufferSize
- size in bytes for internal buffer.
-
-
Method Details
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
flush
Flush the internal buffer to the encapsulated output stream. Zero the buffer contents when done.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
- on error.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-