public interface CborWriter
CborObject instances into CBOR-encoded data.CborReader| Modifier and Type | Method and Description |
|---|---|
static CborWriter |
createFromByteBuffer(ByteBuffer byteBuffer)
Creates a
CborWriter instance that writes to a ByteBuffer. |
static CborWriter |
createFromOutputStream(OutputStream outputStream)
Creates a
CborWriter instance that writes to an OutputStream. |
static int |
length(CborObject obj)
Calculates the CBOR-encoded length of the given
CborObject. |
CborWriter |
writeDataItem(CborObject obj)
Serializes a
CborObject. |
CborWriter |
writeTag(int tag)
Serializes a CBOR tag.
|
static CborWriter createFromOutputStream(OutputStream outputStream)
CborWriter instance that writes to an OutputStream.static CborWriter createFromByteBuffer(ByteBuffer byteBuffer)
CborWriter instance that writes to a ByteBuffer.static int length(CborObject obj)
CborObject.obj - the CborObject instance to determine the encoded length ofobj.@CanIgnoreReturnValue CborWriter writeDataItem(CborObject obj) throws IOException
CborObject.obj - the CborObject to serializeIOException - if there was a problem with the output mechanism@CanIgnoreReturnValue CborWriter writeTag(int tag) throws IOException
CborTag.SELF_DESCRIBE_CBOR. The tag will be associated with the next object serialized with
writeDataItem(com.google.iot.cbor.CborObject).tag - the value of the tag to serializeIOException - if there was a problem with the output mechanismCopyright © 2018–2023. All rights reserved.