Exemple #1
0
        private static Utf8String GetUtf8String(JsonParseObject json)
        {
            var typeCode = json._buffer[json._start + 8];

            if (typeCode == (byte)JsonParser.JsonDb.JsonValueType.Object || typeCode == (byte)JsonParser.JsonDb.JsonValueType.Array)
            {
                throw new InvalidCastException();
            }

            int location = BitConverter.ToInt32(json._buffer, json._start);
            int length   = BitConverter.ToInt32(json._buffer, json._start + 4);

            return(new Utf8String(json._buffer, location, length));
        }
        private static Utf8String GetUtf8String(JsonParseObject json)
        {
            var typeCode = json._buffer[json._start + 8];

            if (typeCode == (byte)JsonParser.JsonValueType.Object || typeCode == (byte)JsonParser.JsonValueType.Array)
            {
                throw new InvalidCastException();
            }

            int location = BitConverter.ToInt32(json._buffer, json._start);
            int length = BitConverter.ToInt32(json._buffer, json._start + 4);
            return new Utf8String(json._buffer, location, length);
        }