addBlob method

void addBlob(
  1. ByteBuffer value
)

Adds a byte array.

This method can be used to store any generic BLOB.

Implementation

void addBlob(ByteBuffer value) {
  _integrityCheckOnValueAddition();
  final length = value.lengthInBytes;
  final bitWidth = BitWidthUtil.uwidth(length);
  final byteWidth = _align(bitWidth);
  _writeUInt(length, byteWidth);
  final blobOffset = _offset;
  final newOffset = _newOffset(length);
  _pushBuffer(value.asUint8List());
  _offset = newOffset;
  final stackValue =
      _StackValue.withOffset(blobOffset, ValueType.Blob, bitWidth);
  _stack.add(stackValue);
}