public class FastPipedInputStream extends InputStream
java.io.PipedInputStream. In the
interface it only adds a constructor which allows for specifying the buffer
size. Its implementation, however, is much simpler and a lot more efficient
than its equivalent. It doesn't rely on polling. Instead it uses proper
synchronization with its counterpart FastPipedOutputStream.FastPipedOutputStream| Constructor and Description |
|---|
FastPipedInputStream()
Creates an unconnected PipedInputStream with a default buffer size.
|
FastPipedInputStream(FastPipedOutputStream source)
Creates a PipedInputStream with a default buffer size and connects it to
source. |
FastPipedInputStream(FastPipedOutputStream source,
int bufferSize)
Creates a PipedInputStream with buffer size
bufferSize and
connects it to source. |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
connect(FastPipedOutputStream source) |
protected void |
finalize() |
void |
mark(int readLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
reset, skippublic FastPipedInputStream()
public FastPipedInputStream(FastPipedOutputStream source) throws IOException
source.IOException - It was already connected.public FastPipedInputStream(FastPipedOutputStream source, int bufferSize) throws IOException
bufferSize and
connects it to source.IOException - It was already connected.public int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOException - The pipe is not connected.public void connect(FastPipedOutputStream source) throws IOException
IOException - The pipe is already connected.protected void finalize()
throws Throwable
public void mark(int readLimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class InputStreampublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOException - The pipe is not connected.Copyright © 2004–2017. All rights reserved.