Package org.apache.qpid.protonj2.buffer
Class ProtonBufferInputStream
java.lang.Object
java.io.InputStream
org.apache.qpid.protonj2.buffer.ProtonBufferInputStream
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable
An InputStream that can be used to adapt a
ProtonBuffer for use in the
standard streams API. This stream wrapper assumes ownership of the provided stream
and will close it upon a call to the close() method.-
Constructor Summary
ConstructorsConstructorDescriptionProtonBufferInputStream(ProtonBuffer buffer) Creates a newInputStreaminstance that wraps the givenProtonBufferand assumes ownership. -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()intvoidmark(int readlimit) booleanintread()intread(byte[] b, int off, int len) booleanbytereadByte()charreadChar()doublefloatvoidreadFully(byte[] target) voidreadFully(byte[] target, int offset, int length) intreadInt()readLine()longreadLong()shortintintreadUTF()voidreset()longskip(long skipAmount) intskipBytes(int skipAmount) Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, transferTo
-
Constructor Details
-
ProtonBufferInputStream
Creates a newInputStreaminstance that wraps the givenProtonBufferand assumes ownership.- Parameters:
buffer- TheProtonBufferthat thisInputStreamwill read from.
-
-
Method Details
-
getBytesRead
public int getBytesRead()- Returns:
- a running total of the number of bytes that has been read from this
InputStream.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein 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
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-