readBase64String static method

Future<Tag> readBase64String(
  1. String encoded, [
  2. void onReadListener(
    1. int
    )?
])

Implementation

static Future<Tag> readBase64String(String encoded,
    [void Function(int)? onReadListener]) async {
  _io.disposeStream();
  _io = ByteLayer();
  _io.addListener(onReadListener);

  List<int> bytes = base64Encoder.decode(encoded);
  for (int byte in bytes) {
    _io.writeByte(byte);
  }
  _io.resetPosition();
  return Tag.readNamedTag(_io);
}