public class QueueInputStream extends InputStreamSimple alternative to JDK
PipedInputStream; queue input stream provides what's written in queue output stream.
QueueInputStream inputStream = new QueueInputStream(); QueueOutputStream outputStream = inputStream.newQueueOutputStream(); outputStream.write("hello world".getBytes(UTF_8)); inputStream.read();
PipedOutputStream, queue input/output streams may be used safely in a single thread or multiple threads. Also, unlike JDK classes, no special meaning is attached to initial or current thread. Instances can be used longer after initial threads exited.
QueueInputStreamhas no effect. The methods in this class can be called after the stream has been closed without generating an
- See Also:
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description
newQueueOutputStream()Creates a new QueueOutputStream instance connected to this.
read()Reads and returns a single byte.
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
public QueueInputStream()Constructs a new instance with no limit to its internal buffer size.
public QueueOutputStream newQueueOutputStream()Creates a new QueueOutputStream instance connected to this. Writes to the output stream will be visible to this input stream.
- QueueOutputStream connected to this stream
Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.