You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The octet-stream codec enables deserialization and serialization of binary data. To encode and decode sequences of bytes, the octet-stream codec uses the following content type parameters:
29
+
| Parameter | Description | Default |
30
+
| --- | --- | --- |
31
+
|`length`| Number of bytes produced during serialization or consumed during deserialization ||
32
+
|`signed`| Signedness of the data type, `true` or `false`|`true`|
33
+
|`byteSeq`| Endianness, enum of `BIG_ENDIAN`, `LITTLE_ENDIAN`, `BIG_ENDIAN_BYTE_SWAP`, `LITTLE_ENDIAN_BYTE_SWAP`|`BIG_ENDIAN`|
34
+
35
+
Additionally, the octet-stream codec supports the data schema terms below for addressing bit-fields:
36
+
| Term | Description | Default |
37
+
| --- | --- | --- |
38
+
|`ex:bitLength`| Number of bits produced during serialization or consumed during deserialization ||
39
+
|`ex:bitOffset`| Offset in bits from the beginning of the byte sequence |`0`|
40
+
41
+
With the help of the terms and parameters above, the octet-stream codec can be used to serialize and deserialize objects containing bit-fields and sequences of bytes, like in the following example.
42
+
43
+
#### Example
44
+
45
+
To serialize the object `{ flag1: true, numberProperty: 99, stringProperty: "Web" }` to a sequence of bytes, the content type `application/octet-stream;length=4;signed=false;`, along with the following data schema can be used:
0 commit comments