hudson.remoting
public class FastPipedInputStream extends java.io.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) |
public FastPipedInputStream()
public FastPipedInputStream(FastPipedOutputStream source) throws java.io.IOException
source
.java.io.IOException
- It was already connected.public FastPipedInputStream(FastPipedOutputStream source, int bufferSize) throws java.io.IOException
bufferSize
and
connects it to source
.java.io.IOException
- It was already connected.public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
- The pipe is not connected.public void connect(FastPipedOutputStream source) throws java.io.IOException
java.io.IOException
- The pipe is already connected.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void mark(int readLimit)
mark
in class java.io.InputStream
public boolean markSupported()
markSupported
in class java.io.InputStream
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- The pipe is not connected.Copyright © 2014. All Rights Reserved.