Package org.jenkinsci.remoting.util
Class ByteBufferQueueInputStream
java.lang.Object
java.io.InputStream
org.jenkinsci.remoting.util.ByteBufferQueueInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
An
InputStream
backed by a ByteBufferQueue
. Assumes that the backing ByteBufferQueue
will
not be updated by another thread during calls to read()
so all methods are non-blocking and an empty
ByteBufferQueue
is deemed equivalent to end of stream.- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance.ByteBufferQueueInputStream
(ByteBufferQueue queue, int length) Constructs a new instance. -
Method Summary
Methods inherited from class java.io.InputStream
close, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
ByteBufferQueueInputStream
Constructs a new instance.- Parameters:
queue
- the backingByteBufferQueue
.
-
ByteBufferQueueInputStream
Constructs a new instance.- Parameters:
queue
- the backingByteBufferQueue
.length
- the limit of bytes to take from the backing queue.
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-