Package hudson.remoting
Class FastPipedInputStream
java.lang.Object
java.io.InputStream
hudson.remoting.FastPipedInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
This class is equivalent to
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.- Author:
- WD
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an unconnected PipedInputStream with a default buffer size.Creates a PipedInputStream with a default buffer size and connects it tosource.FastPipedInputStream(FastPipedOutputStream source, int bufferSize) Creates a PipedInputStream with buffer sizebufferSizeand connects it tosource. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
FastPipedInputStream
public FastPipedInputStream()Creates an unconnected PipedInputStream with a default buffer size. -
FastPipedInputStream
Creates a PipedInputStream with a default buffer size and connects it tosource.- Throws:
IOException- It was already connected.
-
FastPipedInputStream
Creates a PipedInputStream with buffer sizebufferSizeand connects it tosource.- Throws:
IOException- It was already connected.
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- The pipe is not connected.
-
connect
- Throws:
IOException- The pipe is already connected.
-
finalize
-
mark
public void mark(int readLimit) - Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException- The pipe is not connected.
-