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.


// w ww.  jav  a 2 s .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);


  }
}