コード例 #1
0
        internal override BlittableJsonReaderArray ReadJson(BlittableJsonReader blittableReader)
        {
            if (!(blittableReader.Value is BlittableJsonReaderArray blittableArrayValue))
            {
                throw new SerializationException(
                          $"Can't convert {blittableReader.Value?.GetType()} type to {nameof(BlittableJsonReaderArray)}. The value must to be an array");
            }

            //Because the value that return is the blittable array as a whole
            //we skip the reading inside this blittable array
            blittableReader.SkipBlittableArrayInside();

            return
                (blittableArrayValue.BelongsToContext(blittableReader.Context)
                    ? blittableArrayValue
                    : blittableArrayValue.Clone(blittableReader.Context));
        }