public void TestSimpleTLV() { byte[] sequence = new byte[] { 0x00, 0x00, 0xAA, 0xAF, 0x00, 0x04, 0x01, 0x02, 0x03, 0x04, 0x05 }; short length = 0; byte[] data = null; Match m = sequence.Parse(Endian.Big, 0x0000AAAF, // type From.Int16((len) => length = len), // length From.Bytes(() => length, (bt) => data = bt) // value ); CollectionAssert.AreEqual(new byte[] { 0x01, 0x02, 0x03, 0x04 }, data); }