Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Nested classes | List of all members
Loyc.SyncLib.SyncJson Class Reference

Contains optimized ISyncManager implementations for reading and writing JSON data (SyncJson.Reader and SyncJson.Writer) plus an options type (SyncJson.Options) and convenience methods for reading and writing objects as JSON (Read, ReadI, Write, WriteI and WriteString methods.) The JSON format is designed to be compatible with Newtonsoft.Json. More...


Source file:

Remarks

Contains optimized ISyncManager implementations for reading and writing JSON data (SyncJson.Reader and SyncJson.Writer) plus an options type (SyncJson.Options) and convenience methods for reading and writing objects as JSON (Read, ReadI, Write, WriteI and WriteString methods.) The JSON format is designed to be compatible with Newtonsoft.Json.

These ISyncManager implementations are designed for both flexibility and performance, helping you convert your business objects directly to or from UTF8 bytes, without the need to allocate temporary strings or DTOs.

For best performance, your synchronizers should read the JSON data in the same order it was written. Synchronizers written in the usual way naturally work this way. Out-of-order reads are supported but are slower and, when reading large JSON files, may use more memory.

You can also make the JSON output more compact by changing options. In particular, set Options.Write.Minify = true and, if you don't need Newtonsoft compatibility, Options.NewtonsoftCompatibility = false.

Nested classes

struct  Writer