BufferedOutputStream Class
Package: java.io
The BufferedOutputStream class writes characters to an output stream, using a buffer for increased efficiency.
You won’t typically work directly with the BufferedOutputStream class; instead, you’ll use it to connect to a DataOutputStream, which has more advanced features for writing input data from binary files. As a result, this section shows only the constructor for the BufferedOutputStream class and not its methods. For more information, see DataOutputStream Class.
Constructor
|
Constructor |
Description |
|
|
Creates a buffered output stream for the specified stream. Typically, you pass this constructor a |
The following example shows how to create a Buffered OutputStream object that connects to a binary file:
File f;
FileOutputStream fstream;
BufferedOutputStream bstream;
f = new File(“myfile.bin”);
fstream = new FileOutputStream(f);
bstream = new BufferedOutputStream(fstream);
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access