Create a new BinaryImpl instance
the internal buffer
the offset of the slice
the number of bytes in the slice
The internal buffer
The number of bytes in the slice
The offset of the slice
Apply a delta to this Binary value to create a new value.
Convenient equivalent to:
diffusion.datatypes.binary().deltaSupport(delta).apply(this, delta);
the binary delta to apply to this value
a new instance derived from applying the delta to this value
Get a copy of the array containing this value.
This value in binary form
Get a copy of the buffer containing this value.
This value in binary form
Compare this Binary value with an earlier version to create a delta.
Convenient equivalent to:
diffusion.datatypes.binary().deltaSupport(type).diff(original, this);
Buffers stored in a Uint8Array may also be provided as the value to diff instead of a
Binary instance.
Example:
Node.js:
const delta = binaryValue.diff(Buffer.from('Hello world'));
Browser:
const delta = binaryValue.diff(new TextEncoder().encode('Hello World'));
the value to diff against this
the type of delta to generate (default: binary);
a delta representing the difference between this and the provided value
Check if the Bytes are equal to a buffer slices
the buffer
the offset of the slice
the number of bytes in the slice
true if the two bytes are equal
Check if the Bytes are equal to a buffer slices
the buffer slice
true if the two bytes are equal
Get the value as a Buffer.
the buffer value
Get the value as a Uint8Array.
the array value
Get the number of bytes
The length of the data in bytes
Convert the objet to a string
a string representation of the BinaryImpl
Create a new BinaryImpl object from a buffer or BinaryImpl. If a BinaryImpl is passed as argument it is simply returned.
the object to create a record from
the record created
Return the name of the data type
BinaryImpl
Copyright © 2025 DiffusionData Ltd. All Rights Reserved.
Implementation of Binary