| java.lang.Object | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | | - | - | java.io.OutputStream | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | | - | - | java.io.FilterOutputStream | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | | - | - | java.io.BufferedOutputStream | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The class implements a buffered output stream.
| Constructor | Summary |
|---|---|
| BufferedOutputStream(OutputStream out) | Creates a new buffered output stream to write data to the specified underlying output stream. |
| BufferedOutputStream(OutputStream out, int size) | Creates a new buffered output stream to write data to the specified underlying output stream with the specified buffer size. |
| Return | Method | Summary |
|---|---|---|
| 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. |
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
public class Main {
public static void main(String[] args) throws Exception {
BufferedOutputStream bufferedOutput = new BufferedOutputStream(new FileOutputStream(
"yourFile.txt"));
bufferedOutput.write("java2s.com".getBytes());
bufferedOutput.write("\n".getBytes());
bufferedOutput.write('a');
bufferedOutput.write(65);
bufferedOutput.close();
}
}
java2s.com | | Contact Us | Privacy Policy |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |