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
ConstructorDescriptionCreates 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 sizebufferSize
and connects it tosource
. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, 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 sizebufferSize
and connects it tosource
.- Throws:
IOException
- It was already connected.
-
-
Method Details
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
- The pipe is not connected.
-
connect
- Throws:
IOException
- The pipe is already connected.
-
finalize
-
mark
public void mark(int readLimit) - Overrides:
mark
in classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
- The pipe is not connected.
-