public class DynamicCompositeByteBufInputStream extends InputStream implements DataInput
InputStream which reads data from a DynamicCompositeByteBuf.
A read operation against this stream will occur at the readerIndex
of its underlying buffer and the readerIndex will increase during
the read operation. Please note that it only reads up to the number of
readable bytes of its underlying buffer.
This stream implements DataInput for your convenience.
| Constructor and Description |
|---|
DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf compositeByteBuf)
Creates a new stream which reads data from the specified
buffer |
DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf buffer,
boolean releaseOnClose)
Creates a new stream which reads data from the specified
buffer |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
long |
skip(long n) |
int |
skipBytes(int n) |
mark, read, resetpublic DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf compositeByteBuf)
buffercompositeByteBuf - The buffer which provides the content for this InputStream.public DynamicCompositeByteBufInputStream(DynamicCompositeByteBuf buffer, boolean releaseOnClose)
bufferbuffer - The buffer which provides the content for this InputStream.releaseOnClose - true means that when close() is called
then DynamicCompositeByteBuf.release()
will be called on buffer.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreampublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOExceptionpublic boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOExceptionpublic byte readByte()
throws IOException
readByte in interface DataInputIOExceptionpublic char readChar()
throws IOException
readChar in interface DataInputIOExceptionpublic double readDouble()
throws IOException
readDouble in interface DataInputIOExceptionpublic float readFloat()
throws IOException
readFloat in interface DataInputIOExceptionpublic void readFully(byte[] b)
throws IOException
readFully in interface DataInputIOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputIOExceptionpublic int readInt()
throws IOException
readInt in interface DataInputIOExceptionpublic String readLine() throws IOException
readLine in interface DataInputIOExceptionpublic long readLong()
throws IOException
readLong in interface DataInputIOExceptionpublic short readShort()
throws IOException
readShort in interface DataInputIOExceptionpublic String readUTF() throws IOException
readUTF in interface DataInputIOExceptionpublic int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOExceptionpublic int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOExceptionCopyright © 2022 Baidu, Inc.. All rights reserved.