public final class BinaryPipe extends Object
This is a port of Go's io.Pipe. Like io.Pipe
, each write to a PipedOutputStream
blocks until all of its data has been consumed, either through reads or skips. Data is copied directly from the output stream to the input stream
without any internal buffering.
Because reads and writes both block, writing to and reading from the pipe should not be done from the same thread. Attempting to do so will introduce deadlocks.
Constructor and Description |
---|
BinaryPipe()
Creates a new binary pipe.
|
Modifier and Type | Method and Description |
---|---|
boolean |
closed()
Returns whether or not the pipe is closed.
|
PipeInputStream |
input()
Returns the pipe's input stream.
|
PipeOutputStream |
output()
Returns the pipe's output stream.
|
public PipeInputStream input()
public PipeOutputStream output()
Copyright © 2020–2024. All rights reserved.