toBitArray method
Implementation
BitArray toBitArray(List<int> text) {
// Reverse the tokens, so that they are in the order that they should
// be output
final List<Token> symbols = [];
for (Token? token = endBinaryShift(text.length)._token;
token != null;
token = token.previous) {
symbols.insert(0, token);
}
final BitArray bitArray = BitArray();
// Add each token to the result.
for (Token symbol in symbols) {
symbol.appendTo(bitArray, text);
}
//assert bitArray.getSize() == this.bitCount;
return bitArray;
}