PipedInputStream (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Field Summary
Fields
protected byte[]The circular buffer into which incoming data is placed.
protected intThe index of the position in the circular buffer at which the next byte of data will be stored when received from the connected piped output stream.
protected intThe index of the position in the circular buffer at which the next byte of data will be read by this piped input stream.
protected static final intThe default size of the pipe's circular input buffer.
-
Constructor Summary
Constructors
Creates a
PipedInputStreamso that it is not yet connected.PipedInputStream(int pipeSize) Creates a
PipedInputStreamso that it is not yet connected and uses the specified pipe size for the pipe's buffer.Creates a
PipedInputStreamso that it is connected to the piped output streamsrc.Creates a
PipedInputStreamso that it is connected to the piped output streamsrcand uses the specified pipe size for the pipe's buffer. -
Method Summary
intReturns the number of bytes that can be read from this input stream without blocking.
voidclose()Closes this input stream and releases any system resources associated with the stream.
voidCauses this piped input stream to be connected to the piped output stream
src.intread()Reads the next byte of data from this piped input stream.
intread(byte[] b, int off, int len) Reads up to
lenbytes of data from this piped input stream into an array of bytes.protected voidreceive(int b) Methods declared in class InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
PIPE_SIZE
-
buffer
-
in
-
out
-
-
Constructor Details
-
PipedInputStream
-
PipedInputStream
-
PipedInputStream
-
PipedInputStream
-
-
Method Details
-
connect
-
receive
-
read
-
read
-
available
-
close
-