Create a new instance of BinaryDeltaTypeImpl
constructor function to create new instances of the type T
conversion function to calculate a CBOR buffer from the value
conversion function to calculate the value from a CBOR buffer
The Myers Binary Difference algorithm to calculate the differences
Conversion function to calculate the value from a CBOR buffer
Constructor function to create new instances of the type T
Conversion function to calculate a CBOR buffer from the value
Apply a delta to a value.
the delta to apply
the new value generated applying the delta to the old value
Apply a delta to a buffer or a value, returning the new value together with the modified CBOR buffer
the delta to apply
the old CBOR buffer
the new value and CBOR buffer generated applying the delta to the old value
Create a delta from two values.
If there are many differences between oldValue and newValue, the result might require more bytes to transmit than the new value, or be computationally expensive to apply. In this case, it is better to discard oldValue and publish newValue in its place. This can be checked using DeltaType.isValueCheaper.
The implementation can return the special constant DeltaType.noChange to indicate the old value and new value are equivalent and there is no change to publish.
the old value
the new value
the delta between values
Calculate if value is cheaper than the delta. The
result is typically determined by the length of the serialised form, but may
also consider the complexity of the delta.
the value to compare
the delta to compare
true if the value is considered cheaper than the delta
The name of this delta type
the name
Constant returned by DeltaType.diff to indicate that both values are equivalent.
unique object representing no change in value
Parse a delta from binary.
the offset from which to start reading from the buffer
the length of data to read from the buffer
the delta
Serialise a delta to binary.
the delta to serialise
the serialised form of the delta
Serialise a delta to binary.
the delta to serialise
the serialised form of the delta
Copyright © 2025 DiffusionData Ltd. All Rights Reserved.
Implementation of DeltaType