/** * */ package kernel; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; /** * Defines a pipe * * @author Jan Horky * */ public class Pipe { InputStream in; OutputStream out; public Pipe() throws IOException { this.in = new PipedInputStream(); this.out = new PipedOutputStream((PipedInputStream) this.in); } public synchronized InputStream getPipeIn() { return this.in; } public synchronized OutputStream getPipeOut() { return this.out; } public synchronized void setPipeIn(InputStream in) { this.in = in; } public synchronized void setPipeOut(OutputStream out) { this.out = out; } }