-
Notifications
You must be signed in to change notification settings - Fork 3
Wff Binary Message
Wff binary message is a message format which can hold binary data. Unlike in bson/json, wff binary message is a collection of name-values pairs where both name and values can be binary data and it can also have duplicate names. It's implemented in com.webfirmframework.wffweb.util.WffBinaryMessageUtil. The length of wff binary message is less than that of a bson bytes. And encoding and decoding of wff binary message is many times faster than bson format. It is proved in com.webfirmframework.wffweb.util.WffBinaryMessageUtilTest test case.
The wff binary message is composed as follows :-
The first byte represents the maximum number of bytes for name length bytes. The second byte represents the maximum number of bytes for the value length bytes. The remaining bytes represent the name-value pairs.
| name length bytes | name bytes | value length bytes | value bytes |
|---|
Here, the name length bytes is the length of name bytes and value length bytes is the length of value bytes.
If the value bytes is an array of values then each value is prepended with length of value and will be appended with char A.
| total value length bytes | value length bytes | value bytes | value length bytes | value bytes | A |
|---|
Here, total value length bytes = sum of (value length bytes + value bytes + value length bytes + value bytes) no. of bytes.And, A is represented as the extra identifier byte which represents the value as an array. The total value length bytes doesn't include the length of A (i.e. 1).
We will soon implement wff binary message algorithm in other languages like javascript, objective-c etc... Or, if you want us to immediately implement this algorithm in any other languages, please create a ticket for it.
Refer wffweb-javadoc, Watch technical videos
Feel free to write us @ [email protected] for any assistance
or
[email protected] for any technical support.
webfirmframework.com since 2014