java.io.BufferedOutputStream
The BufferedOutputStream class of java.io package, the class implements a buffered output stream. By setting up such an output stream, an application can write bytes to the underlying output stream without necessarily causing a call to the underlying system for each byte written.
File Class Syntax
public class BufferedOutputStream
extends FilterOutputStream
BufferedOutputStream Class Compatibility Version
BufferedOutputStream Class is available since Java 1.0
Basic Usage of BufferedOutputStream
The BufferedOutputStream class as part of the java.io package is one of the classes of the java api that is widely used because it provides mechanism in writing a stream. This class offer methods to write on file, however since the methods available is hard to use, as a general practice it is recommended to wrap it to more user friendly OutputStreamWriter class.
BufferedOutputStream Method Usage Examples
The following are the detailed list of BufferedOutputStream methods and descriptions. We have also provided links to examples of each method on the list.
Modifier and Type | Method and Description |
---|---|
void | flush() Flushes this buffered output stream. |
void | write(byte[] b, int off, int len) Writes len bytes from the specified byte array starting at offset off to this buffered output stream. |
void | write(int b) Writes the specified byte to this buffered output stream. |