JsonPack

Namespace: SnowBank.Data.Json.Binary · class

Fast and compact binary JSON encoder

Remarks

Generates the smallest payload possible and intended for cases where the entire document must be decoded

For cases where only part of the document needs to be read (indexing, filtering), please consider using Jsonb instead.

Methods

Decode

static JsonValue Decode(byte[] buffer, CrystalJsonSettings settings = null, StringTable table = null)

Parses JsonPack binary blob into the corresponding JsonValue

static JsonValue Decode(Slice buffer, CrystalJsonSettings settings = null, StringTable table = null)

Parses JsonPack binary blob into the corresponding JsonValue

static JsonValue Decode(byte[] buffer, int offset, int count, CrystalJsonSettings settings = null, StringTable table = null)

Parses JsonPack binary blob into the corresponding JsonValue

Encode

static Slice Encode(JsonValue value, CrystalJsonSettings settings = null)

Encodes a JsonValue into a JsonPack binary blob

EncodeTo

static Slice EncodeTo(ref SliceWriter writer, JsonValue value, CrystalJsonSettings settings = null)

Encodes a JsonValue into a JsonPack binary blob

ParseObject

static JsonObject ParseObject(ref SliceReader reader, int token, CrystalJsonSettings settings)

Parses a JSON Object encoded as JsonPack from the specified reader

WriteValue

static void WriteValue(ref SliceWriter writer, JsonValue value, CrystalJsonSettings settings)

Outputs a JSON value encoded as JsonPack into the specified buffer