- java.lang.Object
- 
- java.io.InputStream
- 
- io.netty5.buffer.BufferInputStream
 
 
- 
- All Implemented Interfaces:
- Closeable,- DataInput,- AutoCloseable
 
 public final class BufferInputStream extends InputStream implements DataInput AnInputStreamwhich reads data from aBuffer.A read operation against this stream will occur at the readerOffsetof its underlying buffer and thereaderOffsetwill increase during the read operation. Please note that it only reads up to the number of readable bytes determined at the moment of construction. Therefore, updatingBuffer.writerOffset()will not affect the return value ofavailable().This stream implements DataInputfor your convenience. The endianness of the stream is always big endian.- See Also:
- BufferOutputStream
 
- 
- 
Constructor SummaryConstructors Constructor Description BufferInputStream(Send<Buffer> buffer)Creates a new stream which reads data from the specifiedbufferstarting at the currentreaderOffsetand ending at the currentwriterOffset.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b, int off, int len)booleanreadBoolean()bytereadByte()intreadBytes()Returns the number of read bytes by this stream so far.charreadChar()doublereadDouble()floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()StringreadLine()longreadLong()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()voidreset()longskip(long n)intskipBytes(int n)- 
Methods inherited from class java.io.InputStreamnullInputStream, read, readAllBytes, readNBytes, readNBytes, transferTo
 
- 
 
- 
- 
- 
Constructor Detail- 
BufferInputStreampublic BufferInputStream(Send<Buffer> buffer) Creates a new stream which reads data from the specifiedbufferstarting at the currentreaderOffsetand ending at the currentwriterOffset.When this BufferInputStreamis closed, then the sent buffer will also be closed.- Parameters:
- buffer- The buffer which provides the content for this- InputStream.
 
 
- 
 - 
Method Detail- 
readBytespublic int readBytes() Returns the number of read bytes by this stream so far.
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- InputStream
- Throws:
- IOException
 
 - 
availablepublic int available() throws IOException- Overrides:
- availablein class- InputStream
- Throws:
- IOException
 
 - 
markpublic void mark(int readlimit) - Overrides:
- markin class- InputStream
 
 - 
markSupportedpublic boolean markSupported() - Overrides:
- markSupportedin class- InputStream
 
 - 
readpublic int read() throws IOException- Specified by:
- readin class- InputStream
- Throws:
- IOException
 
 - 
readpublic int read(byte[] b, int off, int len) throws IOException- Overrides:
- readin class- InputStream
- Throws:
- IOException
 
 - 
resetpublic void reset() throws IOException- Overrides:
- resetin class- InputStream
- Throws:
- IOException
 
 - 
skippublic long skip(long n) throws IOException- Overrides:
- skipin class- InputStream
- Throws:
- IOException
 
 - 
readBooleanpublic boolean readBoolean() throws IOException- Specified by:
- readBooleanin interface- DataInput
- Throws:
- IOException
 
 - 
readBytepublic byte readByte() throws IOException- Specified by:
- readBytein interface- DataInput
- Throws:
- IOException
 
 - 
readCharpublic char readChar() throws IOException- Specified by:
- readCharin interface- DataInput
- Throws:
- IOException
 
 - 
readDoublepublic double readDouble() throws IOException- Specified by:
- readDoublein interface- DataInput
- Throws:
- IOException
 
 - 
readFloatpublic float readFloat() throws IOException- Specified by:
- readFloatin interface- DataInput
- Throws:
- IOException
 
 - 
readFullypublic void readFully(byte[] b) throws IOException- Specified by:
- readFullyin interface- DataInput
- Throws:
- IOException
 
 - 
readFullypublic void readFully(byte[] b, int off, int len) throws IOException- Specified by:
- readFullyin interface- DataInput
- Throws:
- IOException
 
 - 
readIntpublic int readInt() throws IOException- Specified by:
- readIntin interface- DataInput
- Throws:
- IOException
 
 - 
readLinepublic String readLine() throws IOException - Specified by:
- readLinein interface- DataInput
- Throws:
- IOException
 
 - 
readLongpublic long readLong() throws IOException- Specified by:
- readLongin interface- DataInput
- Throws:
- IOException
 
 - 
readShortpublic short readShort() throws IOException- Specified by:
- readShortin interface- DataInput
- Throws:
- IOException
 
 - 
readUTFpublic String readUTF() throws IOException - Specified by:
- readUTFin interface- DataInput
- Throws:
- IOException
 
 - 
readUnsignedBytepublic int readUnsignedByte() throws IOException- Specified by:
- readUnsignedBytein interface- DataInput
- Throws:
- IOException
 
 - 
readUnsignedShortpublic int readUnsignedShort() throws IOException- Specified by:
- readUnsignedShortin interface- DataInput
- Throws:
- IOException
 
 - 
skipBytespublic int skipBytes(int n) throws IOException- Specified by:
- skipBytesin interface- DataInput
- Throws:
- IOException
 
 
- 
 
-