public final class PipeInputStream extends InputStream
BinaryPipe
.Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close()
Closes this input stream.
|
void |
close(IOException error)
Closes this input stream.
|
BinaryPipe |
pipe()
Returns the pipe that this input stream is reading from.
|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
mark, markSupported, read, reset
public BinaryPipe pipe()
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public void close()
pipe
will be closed, and attempting to write to the pipe's output
stream will cause an exception to be thrown. When reading from this input stream, -1
is returned, except if an exception is set using
PipeOutputStream.close(IOException)
.
This method is like close(IOException)
, except it does not change the exception thrown from the pipe's output stream's methods.
This allows the use of close(IOException)
inside try-with-resources blocks without the automatic closing resetting the error.
It is possible to call close()
and close(IOException)
several times. This can be used to change the exception to throw when
writing to the pipe's output stream.
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
public void close(IOException error)
pipe
will be closed, and attempting to write to the pipe's output
stream will cause an exception to be thrown. When reading from this input stream, -1
is returned, except if an exception is set using
PipeOutputStream.close(IOException)
.
It is possible to call close()
and close(IOException)
several times. This can be used to change the exception to throw when
writing to the pipe's output stream.
error
- If not null
, the exception to throw when writing to the pipe's output stream.
Otherwise an exception is thrown that indicates the stream is closed.Copyright © 2020–2024. All rights reserved.