The CBOR writer that is able to write CBOR-encoded data to a stream.
More...
The CBOR writer that is able to write CBOR-encoded data to a stream.
The output is not validated which allows for illegal CBOR to be created by this writer.
PushTechnology.ClientInterface.IO.CBOR.CBORWriter.CBORWriter |
( |
Stream |
outputStream | ) |
|
Creates a new CBORWriter that is able to write CBOR-encoded data to a given output stream.
The reader does not take ownership of the given outputStream . The stream needs to be disposed of if it is no longer needed.
- Parameters
-
outputStream | The output stream to write CBOR-encoded data to. |
- Exceptions
-
ArgumentNullException | The given stream is null . |
ArgumentException | The given stream does not support writing. |
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.Flush |
( |
| ) |
|
Causes any buffered data to be written to the stream.
static int PushTechnology.ClientInterface.IO.CBOR.CBORWriter.GetEncodedByteSize |
( |
int |
byteLength | ) |
|
|
static |
Returns the size of a byte sequence if encoded in CBOR.
- Parameters
-
byteLength | The length of the byte sequence to be encoded in CBOR. |
- Returns
- The size in bytes of the CBOR-encoded byte sequence.
static int PushTechnology.ClientInterface.IO.CBOR.CBORWriter.GetEncodedIntegerSize |
( |
long |
integerValue | ) |
|
|
static |
Returns the size of a integer if encoded in CBOR.
- Parameters
-
integerValue | The integer value to be encoded in CBOR. |
- Returns
- The size in bytes of the CBOR-encoded integer value.
static int PushTechnology.ClientInterface.IO.CBOR.CBORWriter.GetEncodedStringSize |
( |
string |
stringValue | ) |
|
|
static |
Returns the size of a UTF-8 encoded string if encoded in CBOR.
- Parameters
-
stringValue | The string value to be encoded in CBOR. |
- Returns
- The size in bytes of the CBOR-encoded UTF-8 string.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.Write |
( |
bool |
value | ) |
|
Writes a CBOR boolean to the stream.
- Parameters
-
value | The boolean value to write to the stream. |
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.Write |
( |
long |
value | ) |
|
Writes a CBOR integer to the stream.
- Parameters
-
value | The integer value to write to the stream. |
The integer gets encoded in the smallest possible data type. See GetEncodedIntegerSize(long) to receive the size of the encoded value.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.Write |
( |
float |
value | ) |
|
Writes a 32-bit CBOR floating point to the stream.
- Parameters
-
value | The 32-bit floating point value to write to the stream. |
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.Write |
( |
double |
value | ) |
|
Writes a 64-bit CBOR floating point to the stream.
- Parameters
-
value | The 64-bit floating point value to write to the stream. |
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.Write |
( |
byte[] |
value, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
Writes a sequence of bytes to the stream.
- Parameters
-
value | The byte sequence to write to the stream. |
offset | The starting index of the sequence. |
length | The length of the sequence. |
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.Write |
( |
string |
value | ) |
|
Writes a CBOR string value to the stream.
- Parameters
-
value | The string value to write to the stream. |
The string will be encoded in UTF-8 and can be a string value or a field name for key/value pairs.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.WriteArray |
( |
| ) |
|
Writes a indefinite length CBOR array to the stream.
The array has to be closed by a CBOR Break in order to be valid.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.WriteArray |
( |
int |
length | ) |
|
Writes a CBOR array with a specific number of items to the stream.
- Parameters
-
length | The number of items within the array. |
This method has to be followed with the exact amount of items specified by the given length in order for the resulting CBOR to be valid.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.WriteBreak |
( |
| ) |
|
Writes a CBOR Break to the stream that indicates the end of a sequence or structure.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.WriteIndefiniteBytes |
( |
| ) |
|
Writes a indefinite length byte sequence to the stream.
The byte sequence has to be followed by a CBOR Break in order to be valid.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.WriteIndefiniteString |
( |
| ) |
|
Writes a indefinite length CBOR string value to the stream.
The string sequence has to be followed by a CBOR Break in order to be valid.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.WriteNull |
( |
| ) |
|
Writes a CBOR 'null' value to the stream.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.WriteObject |
( |
| ) |
|
Writes a indefinite length CBOR object to the stream.
The object has to be closed by a CBOR Break in order to be valid.
void PushTechnology.ClientInterface.IO.CBOR.CBORWriter.WriteObject |
( |
int |
length | ) |
|
Writes a CBOR object with a specific number of key/value pairs to the stream.
- Parameters
-
length | The number of key/value pairs within the object. |
This method has to be followed with the exact amount of key/value pairs specified by the given length in order for the resulting CBOR to be valid.
Stream PushTechnology.ClientInterface.IO.CBOR.CBORWriter.BaseStream => writer.BaseStream |
Returns the underlying stream.
The documentation for this class was generated from the following file:
- IO.Public/CBOR/CBORWriter.cs