Java BufferedInputStream (InputStream in) Constructor

Syntax

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

public BufferedInputStream(InputStream in)

Example

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


import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
//from  ww  w .  ja v  a 2s.  c o m
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);

  }
}