-
Notifications
You must be signed in to change notification settings - Fork 7
Encoding
This is the convention about writing primitive type to stream
. Protocol and blob messages always use it. There are some situations in program, when other convensions are used, but they will be explicitally signed in documentation. The convention uses always little endian.
All basic trasmission functions are implemented in Premy.Chatovatko.Libs.DataTransmission
.
int
written in little endian order into stream.
First of all, the number of bytes to receive is sended (int
) and after it bytes itself.
All strings are encoded to UTF-8 and then send as byte[]
.
All Json serializations are made by Json.NET. See their documentation for details.
After serialization is done, the result is sended as string.
{}
means an json object. {String theName, String theSecondName = "blabla"}
means an object contain string named "theName" and string named "theSecondName". "theSecondName" must be "blabla". Analogically the same Boolean and Number.
Array theName [{Number a}]
means, that theName is an array of {Number a}
objects.
String?/Array?/... theName
means, that theName is optional.
DateTimes are written in ISO 8601 convention. byte[]
are saved as base64 strings.