Java IO Tutorial - Java PipedOutputStream (PipedInputStream snk) Constructor








Syntax

PipedOutputStream(PipedInputStream snk) constructor from PipedOutputStream has the following syntax.

public PipedOutputStream(PipedInputStream snk)     throws IOException

Example

In the following code shows how to use PipedOutputStream.PipedOutputStream(PipedInputStream snk) constructor.

/*  w  ww .  j  a v a  2 s.c o m*/

import java.io.PipedInputStream;
import java.io.PipedOutputStream;

public class Main  {

  public static void main(String[] args) throws Exception {
    PipedInputStream in = new PipedInputStream(20);
    PipedOutputStream out = new PipedOutputStream(in);

    out.close();
  }
}