SFSObject and
SFSArray classes represent a platform-neutral, high level Java objects that abstract the data transport between client and server.
They are used to respectively represent data in form of a map and a list; they can be nested and transport many different data types.
These objects provide high speed serialization using the default SmartFoxServer binary protocol and the types distinction grants a fine-grained size control of data sent over the network.
The following is a list of types supported by the SFSObject class:
- null
- boolean
- byte (8 bit integer)
- short (16 bit integer)
- int (32 bit integer)
- long (64 bit integer)
- float (32 bit floating point number)
- double (64 bit double precision number)
- utf-string (UTF-8 encoded string, with length up to 32 KBytes)
- text (UTF-8 encoded string, with length up to 2 GBytes)
- boolean array
- byte array
- short array
- int array
- long array
- float array
- double array
- utf-string array
- SFSObject
- SFSArray
SFSObjects and SFSArrays can be nested to create complex data structures.
Notes
- For members of the SFSObject class, please refer to its Javadoc.
- SFSObject key strings are limited to ASCII characters.
- SFSObject string values support UTF-8 encoding.
- In JavaScript, long integer numbers are limited to Number.MAX_SAFE_INTEGER (positive and negative, inclusive).
This is inconsistent with the max and min Long values available in Java, which are down to
-2^63
and up to (2^63)-1
.
See also