Class ReadableBuffers.BufferInputStream
java.lang.Object
java.io.InputStream
io.grpc.internal.ReadableBuffers.BufferInputStream
- All Implemented Interfaces:
Detachable, HasByteBuffer, KnownLength, Closeable, AutoCloseable
- Enclosing class:
ReadableBuffers
private static final class ReadableBuffers.BufferInputStream
extends InputStream
implements KnownLength, HasByteBuffer, Detachable
An
InputStream that is backed by a ReadableBuffer.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the total number of bytes that can be read (or skipped over) from this object until all bytes have been read out.booleanIndicates whether or notHasByteBuffer.getByteBuffer()operation is supported.voidclose()detach()Detaches the underlying data source from this instance and transfers to anInputStream.Gets aByteBuffercontaining some bytes of the content next to be read, ornullif has reached end of the content.voidmark(int readlimit) booleanintread()intread(byte[] dest, int destOffset, int length) voidreset()longskip(long n) Methods inherited from class InputStream
read
-
Field Details
-
buffer
-
-
Constructor Details
-
BufferInputStream
-
-
Method Details
-
available
Description copied from interface:KnownLengthReturns the total number of bytes that can be read (or skipped over) from this object until all bytes have been read out.- Specified by:
availablein interfaceKnownLength- Overrides:
availablein classInputStream- Throws:
IOException
-
read
public int read()- Specified by:
readin classInputStream
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin 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
-
byteBufferSupported
public boolean byteBufferSupported()Description copied from interface:HasByteBufferIndicates whether or notHasByteBuffer.getByteBuffer()operation is supported.- Specified by:
byteBufferSupportedin interfaceHasByteBuffer
-
getByteBuffer
Description copied from interface:HasByteBufferGets aByteBuffercontaining some bytes of the content next to be read, ornullif has reached end of the content. The number of bytes contained in the returned buffer is implementation specific. Calling this method does not change the position of the input stream. The returned buffer's content should not be modified, but the position, limit, and mark may be changed. Operations for changing the position, limit, and mark of the returned buffer does not affect the position, limit, and mark of this input stream. This is an optional method, so callers should first checkHasByteBuffer.byteBufferSupported().- Specified by:
getByteBufferin interfaceHasByteBuffer
-
detach
Description copied from interface:DetachableDetaches the underlying data source from this instance and transfers to anInputStream. Detaching data from an already-detached instance gives an InputStream with zero bytes of data.- Specified by:
detachin interfaceDetachable
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-