getEDFBytes method
Implementation
Uint8List getEDFBytes() {
final numberOfThirds = (characterLength / 4.0).ceil();
final result = Uint8List(numberOfThirds * 3);
int pos = fromPosition;
final endPos =
math.min(fromPosition + characterLength - 1, input.length - 1);
for (int i = 0; i < numberOfThirds; i += 3) {
final edfValues = List.filled(4, 0);
for (int j = 0; j < 4; j++) {
if (pos <= endPos) {
edfValues[j] = input.charAt(pos++) & 0x3f;
} else {
edfValues[j] = pos == endPos + 1 ? 0x1f : 0;
}
}
int val24 = edfValues[0] << 18;
val24 |= edfValues[1] << 12;
val24 |= edfValues[2] << 6;
val24 |= edfValues[3];
result[i] = ((val24 >> 16) & 0xff);
result[i + 1] = ((val24 >> 8) & 0xff);
result[i + 2] = (val24 & 0xff);
}
return result;
}