XNIO API 3.0.7.GA

org.xnio.streams
Class Pipe

java.lang.Object
  extended by org.xnio.streams.Pipe

public final class Pipe
extends Object

An in-VM pipe between an input stream and an output stream, which does not suffer from the bugs in PipedInputStream.

Author:
David M. Lloyd

Constructor Summary
Pipe(int bufferSize)
          Construct a new instance.
 
Method Summary
 void await()
          Wait for the read side to close.
 InputStream getIn()
          Get the input (read) side of the pipe.
 OutputStream getOut()
          Get the output (write) side of the pipe.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pipe

public Pipe(int bufferSize)
Construct a new instance.

Parameters:
bufferSize - the buffer size to use
Method Detail

await

public void await()
Wait for the read side to close. Used when the writer needs to know when the reader finishes consuming a message.


getIn

public InputStream getIn()
Get the input (read) side of the pipe.

Returns:
the input side

getOut

public OutputStream getOut()
Get the output (write) side of the pipe.

Returns:
the output side

XNIO API 3.0.7.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.