public class BufferingOutputStream extends OutputStream
The stream zeroes out the internal buffer on each flush.
Constructor and Description |
---|
BufferingOutputStream(OutputStream other)
Create a buffering stream with the default buffer size (4096).
|
BufferingOutputStream(OutputStream other,
int bufferSize)
Create a buffering stream with a specified buffer size.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush()
Flush the internal buffer to the encapsulated output stream.
|
void |
write(byte[] bytes,
int offset,
int len) |
void |
write(int b) |
write
public BufferingOutputStream(OutputStream other)
other
- output stream to be wrapped.public BufferingOutputStream(OutputStream other, int bufferSize)
other
- output stream to be wrapped.bufferSize
- size in bytes for internal buffer.public void write(byte[] bytes, int offset, int len) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
- on error.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
Copyright © 2021 BouncyCastle.org. All rights reserved.