public interface CborReader
CborObject instances.| Modifier and Type | Method and Description |
|---|---|
long |
bytesParsed()
Gets the number of bytes that have been parsed by this instance.
|
static CborReader |
createFromByteArray(byte[] bytes)
Creates a
CborReader instance from a byte array. |
static CborReader |
createFromByteArray(byte[] bytes,
int offset)
Creates a
CborReader instance from a byte array with starting offset. |
static CborReader |
createFromByteArray(byte[] bytes,
int offset,
int objectCount)
Creates a
CborReader instance from a byte array with starting offset and a total
object count. |
static CborReader |
createFromInputStream(InputStream inputStream)
Creates a
CborReader instance from an InputStream instance. |
static CborReader |
createFromInputStream(InputStream inputStream,
int objectCount)
Creates a
CborReader instance from an InputStream instance with a total
object count. |
boolean |
hasRemainingDataItems()
Determines if there are additional data items to parse.
|
CborObject |
readDataItem()
Reads the next available data item as a
CborObject. |
static CborReader createFromInputStream(InputStream inputStream, int objectCount)
CborReader instance from an InputStream instance with a total
object count.inputStream - the InputStream to parseobjectCount - the number of top-level data items that will be generatedCborReader instancestatic CborReader createFromInputStream(InputStream inputStream)
CborReader instance from an InputStream instance.inputStream - the InputStream to parseCborReader instancestatic CborReader createFromByteArray(byte[] bytes, int offset, int objectCount)
CborReader instance from a byte array with starting offset and a total
object count. The resulting CborReader will be configured to emit objectCount
data items. If the input data does not contain objectCount objects, a CborParseException will be thrown from readDataItem()}.bytes - the byte array to parseoffset - where in bytes to start parsingobjectCount - the number of top-level data items that will be generatedCborReader instancestatic CborReader createFromByteArray(byte[] bytes, int offset)
CborReader instance from a byte array with starting offset.bytes - the byte array to parseoffset - where in bytes to start parsingCborReader instancestatic CborReader createFromByteArray(byte[] bytes)
CborReader instance from a byte array.bytes - the byte array to parseCborReader instanceboolean hasRemainingDataItems()
readDataItem(), false otherwise.CborObject readDataItem() throws CborParseException, IOException
CborObject. This method will block until an
entire data item is read.CborParseException - if the data item was corruptedIOException - if there was a problem with the underlying input mechanismNoSuchElementException - if there are no more data items to be readlong bytesParsed()
Copyright © 2018–2023. All rights reserved.