Java BufferedOutputStream Class Tutorial and Example

HQ » Java Tutorial » » BufferedOutputStream
Java BufferedOutputStream Class Tutorial and Example 2018-02-16T07:26:36+00:00

The BufferedOutputStream class of 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 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.

Contact Info


Our Goal

JavaTutorialHQ aims to to be The Ultimate Guide on Java with hundreds of examples from basic to advance Topics.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.