The type of values that can be written
The type of values that will be read
Requires that the buffer be a GrowableBuffer or AppendableStream
The value to assert is an AppendableBuffer
Determines whether the input is a Type with the same class
A value, usually a Type instance
whether this
and otherType
are instances of the same Type class
Appends value bytes to an AppendableBuffer according to the type
Example:
let louis = {
dob: new Date(1437592284193),
id: 9,
name: 'Louis'
},
garfield = {
dob: new Date(1437592284194),
id: 17,
name: 'Garfield'
}
let value = {
leader: {
dob: new Date(1437592284192),
id: 10,
name: 'Joe'
},
members: new Set([louis, garfield]),
money: new Map().set(louis, 23.05).set(garfield, -10.07)
}
tribeType.writeValue(buffer, value)
The buffer to which to append
The value to write
Generated using TypeDoc
A type storing a value of another type through a pointer. If you expect to have the same large value repeated many times, using a pointer will decrease the size of the value
ArrayBuffer
. If the value has already been written, 1 to 2 bytes are likely needed to write the pointer (more if values are far apart in output buffer). In comparison to without a pointer type, only 1 extra byte will be used if the value has not yet been written to the output buffer.Example: