anchor.diff:          0x63,
           0x6f,
           0x6d
  -      ];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, [32, 'http://www.example.com']);
  -      expect(listener.lastTag, 32);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], 'http://www.example.com');
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.uri);
  +      ]);
  +      expect(decoded, CborUri.fromString('http://www.example.com'));
       });
   
       test('Empty single quotes', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x40];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, [[]]);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], []);
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x40]);
  +      expect(decoded, CborBytes([]));
       });
   
       test('4 bytes', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x44, 0x01, 0x02, 0x03, 0x04];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, [
  -        [01, 02, 03, 04]
  -      ]);
  -      expect(listener.lastByteCount, 4);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], [01, 02, 03, 04]);
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x44, 0x01, 0x02, 0x03, 0x04]);
  +      expect(decoded, CborBytes([01, 02, 03, 04]));
       });
   
       test('Empty double quotes', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x60];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['']);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], '');
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x60]);
  +      expect(decoded, CborString(''));
       });
   
       test('a', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x61, 0x61];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['a']);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], 'a');
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x61, 0x61]);
  +      expect(decoded, CborString('a'));
       });
   
       test('IETF', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x64, 0x49, 0x45, 0x54, 0x46];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['IETF']);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], 'IETF');
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x64, 0x49, 0x45, 0x54, 0x46]);
  +      expect(decoded, CborString('IETF'));
       });
   
       test('Quoted backslash', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x62, 0x22, 0x5c];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['\"\\']);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], '\"\\');
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x62, 0x22, 0x5c]);
  +      expect(decoded, CborString('"\\'));
       });
   
       test('Unicode ü', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x62, 0xc3, 0xbc];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['ü']);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], 'ü');
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x62, 0xc3, 0xbc]);
  +      expect(decoded, CborString('ü'));
       });
   
       test('Unicode 水', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x63, 0xe6, 0xb0, 0xb4];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['水']);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], '水');
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x63, 0xe6, 0xb0, 0xb4]);
  +      expect(decoded, CborString('水'));
       });
   
       test('Unicode 𐅑', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x64, 0xf0, 0x90, 0x85, 0x91];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['𐅑']);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], '𐅑');
  -      final item = slistener.itemStack.peek();
  -      expect(item, isNotNull);
  -      expect(item!.hint, cbor.dataHints.none);
  +      final decoded = cbor.decode([0x64, 0xf0, 0x90, 0x85, 0x91]);
  +      expect(decoded, CborString('𐅑'));
       });
   
       test('Array empty', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x80];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastSize, 0);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], []);
  +      final decoded = cbor.decode([0x80]);
  +      expect(decoded, []);
       });
   
       test('Array 1,2,3', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x83, 0x01, 0x02, 0x03];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, [1, 2, 3]);
  -      expect(listener.lastSize, 3);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], [1, 2, 3]);
  +      final decoded = cbor.decode([0x83, 0x01, 0x02, 0x03]);
  +      expect(decoded, [CborSmallInt(1), CborSmallInt(2), CborSmallInt(3)]);
       });
   
       test('Array 1,2,3...25', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [
  +      final decoded = cbor.decode([
           0x98,
           0x19,
           0x01,
  
positive.code:         0x65,
          0x61,
          0x45
        ];
        final buffer = typed.Uint8Buffer();
        buffer.addAll(values);
        output.putBytes(buffer);
        final input = cbor.Input(output.getData());
        final decoder = cbor.Decoder.withListener(input, listener);
        decoder.run();
        expect(listener.lastValue,
            ['a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E']);
        expect(listener.lastSize, 5);
        decoder.listener = slistener;
        input.reset();
        slistener.itemStack.clear();
        decoder.run();
        final decodeStack = cbor.DecodeStack();
        decodeStack.build(slistener.itemStack);
        final slist = decodeStack.walk();
        expect(slist, isNotNull);
        expect(slist!.length, 1);
        expect(slist[0], {'a': 'A', 'b': 'B', 'c': 'C', 'd': 'D', 'e': 'E'});
      });
  
      test("(_ h'0102', h'030405')", () {
        output.clear();
        listener.clear();
        final values = [0x5f, 0x42, 0x01, 0x02, 0x43, 0x03, 0x04, 0x05, 0xff];
        final buffer = typed.Uint8Buffer();
        buffer.addAll(values);
        output.putBytes(buffer);
        final input = cbor.Input(output.getData());
        final decoder = cbor.Decoder.withListener(input, listener);
        decoder.run();
        expect(listener.lastValue, [
          [1, 2],
          [3, 4, 5]
        ]);
        expect(listener.indefiniteStart, isTrue);
        decoder.listener = slistener;
        input.reset();
        slistener.itemStack.clear();
        decoder.run();
        final decodeStack = cbor.DecodeStack();
        decodeStack.build(slistener.itemStack);
        final slist = decodeStack.walk();
        expect(slist, isNotNull);
        expect(slist!.length, 1);
        expect(slist[0], [1, 2, 3, 4, 5]);
      });
  
      test('(_ "strea", "ming")', () {
        output.clear();
        listener.clear();
        final values = [
          0x7f,
          0x65,
          0x73,
  
negative.code:         0x18,
          0x18,
          0x19
        ]);
        expect(decoded is CborList, true);
        if (decoded is CborList) {
          for (var i = 0; i < 25; i++) {
            expect(decoded[i], CborSmallInt(i + 1));
          }
        }
      });
  
      test('Nested array', () {
        final decoded =
            cbor.decode([0x83, 0x01, 0x82, 0x02, 0x03, 0x82, 0x04, 0x05]);
        expect(decoded, [
          CborSmallInt(1),
          [CborSmallInt(2), CborSmallInt(3)],
          [CborSmallInt(4), CborSmallInt(5)],
        ]);
      });
  
      test('Empty Map', () {
        final decoded = cbor.decode([0xa0]);
        expect(decoded, {});
      });
  
      test('{1: 2, 3: 4}', () {
        final decoded = cbor.decode([0xa2, 0x01, 0x02, 0x03, 0x04]);
        expect(decoded, {
          CborSmallInt(1): CborSmallInt(2),
          CborSmallInt(3): CborSmallInt(4),
        });
      });
  
      test('{"a": 1, "b": [2, 3]}', () {
        final decoded =
            cbor.decode([0xa2, 0x61, 0x61, 0x01, 0x61, 0x62, 0x82, 0x02, 0x03]);
        expect(decoded, {
          CborString('a'): CborSmallInt(1),
          CborString('b'): [CborSmallInt(2), CborSmallInt(3)],
        });
      });
  
      test('["a", {"b": "c"}]', () {
        final decoded =
            cbor.decode([0x82, 0x61, 0x61, 0xa1, 0x61, 0x62, 0x61, 0x63]);
        expect(decoded, [
          CborString('a'),
          {
            CborString('b'): CborString('c'),
          },
        ]);
      });
  
      test('{"a": "A", "b": "B", "c": "C", "d": "D", "e": "E"}', () {
        final decoded = cbor.decode([
          0xa5,
          0x61,
          0x61,
  