Java IO Tutorial - Java BufferedInputStream (InputStream in, int size) Constructor








Syntax

BufferedInputStream(InputStream in, int size) constructor from BufferedInputStream has the following syntax.

public BufferedInputStream(InputStream in,     int size)

Example

In the following code shows how to use BufferedInputStream.BufferedInputStream(InputStream in, int size) constructor.

/*from  w w  w . j  a v  a 2  s. com*/
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;

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

    InputStream is = new FileInputStream("C:/test.txt");

    // input stream is converted to buffered input stream
    BufferedInputStream bis = new BufferedInputStream(is,200);

  }
}