public final class TextPipe extends Object
This is a port of Go's io.Pipe. Like io.Pipe
, each write to a PipedWriter
blocks
until all of its data has been consumed, either through reads or skips. Data is copied directly from the writer to the reader 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 |
---|
TextPipe()
Creates a new text pipe.
|
Modifier and Type | Method and Description |
---|---|
boolean |
closed()
Returns whether or not the pipe is closed.
|
PipeReader |
input()
Returns the pipe's reader.
|
PipeWriter |
output()
Returns the pipe's writer.
|
public PipeReader input()
public PipeWriter output()
Copyright © 2020–2024. All rights reserved.