Java IO Tutorial - Java BufferedOutputStream (OutputStream out, int size) Constructor








Syntax

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

public BufferedOutputStream(OutputStream out,     int size)

Example

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

//from   w  ww .  j  a  va 2  s.  co 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,200);


  }
}