decodeGeneralPurposeField method

DecodedInformation decodeGeneralPurposeField(
  1. int pos,
  2. String? remaining
)

Implementation

DecodedInformation decodeGeneralPurposeField(int pos, String? remaining) {
  _buffer.clear();

  if (remaining != null) {
    _buffer.write(remaining);
  }

  _current.position = pos;

  final lastDecoded = _parseBlocks();
  if (lastDecoded != null && lastDecoded.isRemaining) {
    return DecodedInformation(
      _current.position,
      _buffer.toString(),
      lastDecoded.remainingValue,
    );
  }
  return DecodedInformation(_current.position, _buffer.toString());
}