A pipe consists of a pair of channels: A writable sink
channel and a readable source
channel. Once some bytes are written to the sink channel they can be read
from the source channel in exactly the order in which they were written.
Whether or not a thread writing bytes to a pipe will block until another thread reads those bytes, or some previously-written bytes, from the pipe is system-dependent and therefore unspecified. Many pipe implementations will buffer up to a certain number of bytes between the sink and source channels, but such buffering should not be assumed.
Modifier and Type | Class and Description |
---|---|
public abstract static class | Pipe.
A channel representing the writable end of a |
public abstract static class | Pipe.
A channel representing the readable end of a |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public static Pipe | |
public abstract Pipe. | |
public abstract Pipe. |
Pipe | back to summary |
---|---|
protected Pipe() Initializes a new instance of this class. |
open | back to summary |
---|---|
public static Pipe open() throws IOException Opens a pipe. The new pipe is created by invoking the
|
sink | back to summary |
---|---|
public abstract Pipe. Returns this pipe's sink channel.
|
source | back to summary |
---|---|
public abstract Pipe. Returns this pipe's source channel.
|
Pipe
.
Access | Constructor and Description |
---|---|
protected | SinkChannel(SelectorProvider
The selector provider provider)Initializes a new instance of this class. |
Modifier and Type | Method and Description |
---|---|
public final int | Returns: The valid-operation setImplements abstract java. Returns an operation set identifying this channel's supported operations. |
SinkChannel | back to summary |
---|---|
protected SinkChannel(SelectorProvider provider) Initializes a new instance of this class.
|
validOps | back to summary |
---|---|
public final int validOps() Implements abstract java. Returns an operation set identifying this channel's supported operations. Pipe-sink channels only support writing, so this method returns
|
Pipe
.
Access | Constructor and Description |
---|---|
protected | SourceChannel(SelectorProvider
The selector provider provider)Constructs a new instance of this class. |
Modifier and Type | Method and Description |
---|---|
public final int | Returns: The valid-operation setImplements abstract java. Returns an operation set identifying this channel's supported operations. |
SourceChannel | back to summary |
---|---|
protected SourceChannel(SelectorProvider provider) Constructs a new instance of this class.
|
validOps | back to summary |
---|---|
public final int validOps() Implements abstract java. Returns an operation set identifying this channel's supported operations. Pipe-source channels only support reading, so this method
returns
|