pushSampleBytes method

Future<int> pushSampleBytes(
  1. List<Uint8List> data, {
  2. double? timestamp,
  3. bool? pushthrough,
})

Pushes one sample of binary strings (string-format streams only).

Unlike pushSample, each value is sent as raw bytes with an explicit length, so it may contain 0x00 bytes. Inlets can read it back with LSLInlet.pullSampleBytes (or as text with LSLInlet.pullSample when the bytes are valid NUL-free UTF-8). See pushSample for timestamp and pushthrough.

Returns: Error code (0 = success). Throws: LSLException if the stream is not string-format or the value count does not match the channel count.

Implementation

Future<int> pushSampleBytes(
  List<Uint8List> data, {
  double? timestamp,
  bool? pushthrough,
}) => _useIsolates
    ? _pushSampleBytesIsolated(data, timestamp, pushthrough)
    : Future.value(_pushSampleBytesDirect(data, timestamp, pushthrough));