assembleBits function
Implementation
int assembleBits(Uint16List byte) {
if (byte.length != dataLength) {
throw FlutterError('byte_incorrect_size');
}
int assembled = 0;
for (int i = 0; i < dataLength; ++i) {
if (byte[i] != 1 && byte[i] != 0) {
throw FlutterError('bit_not_0_or_1');
}
assembled = assembled << 1;
assembled = assembled | byte[i];
}
return assembled;
}