Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        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);
        }