Package org.jenkinsci.remoting.util
Class FastByteBufferQueueInputStream
java.lang.Object
java.io.InputStream
org.jenkinsci.remoting.util.FastByteBufferQueueInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An
InputStream backed by a set number of bytes from the head of a ByteBufferQueue.
Assumes that the backing ByteBufferQueue will not be read by another thread during calls to read()
so all methods are non-blocking. Does not support mark(int).- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionFastByteBufferQueueInputStream(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
-
FastByteBufferQueueInputStream
Constructs a new instance.- Parameters:
queue- the backingByteBufferQueue.length- the limit of bytes to take from the backing queue.
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-