Java IO Tutorial - Java BufferedOutputStream (OutputStream out) Constructor








Syntax

BufferedOutputStream(OutputStream out) constructor from BufferedOutputStream has the following syntax.

public BufferedOutputStream(OutputStream out)

Example

In the following code shows how to use BufferedOutputStream.BufferedOutputStream(OutputStream out) constructor.

/*from w w  w  . j a  v a2s  . c  o  m*/
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;

public class Main {
  public static void main(String[] args) throws Exception {

    FileInputStream is = new FileInputStream("c:/test.txt");
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    BufferedOutputStream bos = new BufferedOutputStream(baos);


  }
}