Crimson class

Crimson is a JSON parser that is optimized for speed.

Constructors

Crimson(List<int> buffer, [int offset = 0])
Creates a new Crimson instance from a buffer that reads from offset.

Properties

buffer List<int>
The buffer to read from.
final
hashCode int
The hash code for this object.
no setterinherited
offset int
The current offset.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

iterArray() bool
Allows iterating a list value without allocating a List.
iterObject() String?
Allows iterating a map value without allocating a Map.
iterObjectHash() int
Allows iterating a map value without allocating a Map.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read() → dynamic
Reads the next value.
readArray() List
Convenience method to read a list.
readDateTime() DateTime
Reads a DateTime value. Supports both ISO 8601 and UNIX second and millisecond timestamps.
readDouble() double
Reads a double value.
readDoubleOrNull() double?
Reads a double value or null.
readInt() int
Reads an int value.
readIntOrNull() int?
Reads an int value or null.
readNum() num
Reads a numerical value. If the value has a fractional part or is too big, it is returned as a double. Otherwise, it is returned as an int.
readNumOrNull() num?
Reads a numerical value or null. If the value has a fractional part or is too big, it is returned as a double. Otherwise, it is returned as an int.
readObject() Map<String, dynamic>
Convenience method to read a map.
readString() String
Reads a string value.
readStringHash() int
Reads a string value as hash.
readStringOrNull() String?
Reads a string value or null.
skip() → void
Skips the next value.
skipNull() bool
Skips a null value if the next token is null.
skipPartialArray() → void
Skips the remaining values in the current list.
skipPartialObject() → void
Skips the remaining values in the current map.
toString() String
A string representation of this object.
inherited
whatIsNext() JsonType
Returns the type of the next value without consuming it.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

hash(String string) int
Hashes the given String with the same algorithm as readStringHash and iterObjectHash.
override