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
ConstructorsConstructorDescriptionCreate 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:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
flush
Flush the internal buffer to the encapsulated output stream. Zero the buffer contents when done.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException- on error.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-