encode method
Implementation
@override
void encode(EncoderContext context) {
//step C
final buffer = StringBuilder();
while (context.hasMoreCharacters) {
final c = context.currentChar;
context.pos++;
encodeChar(c, buffer);
final count = buffer.length;
if ((count % 3) == 0) {
C40Encoder.writeNextTriplet(context, buffer);
final newMode = HighLevelEncoder.lookAheadTest(
context.message,
context.pos,
encodingMode,
);
if (newMode != encodingMode) {
// Return to ASCII encodation, which will actually handle latch to new mode
context.signalEncoderChange(HighLevelEncoder.asciiEncodation);
break;
}
}
}
handleEOD(context, buffer);
}