public void TestSwitchBytearray()
        {
            var r = SwitchBytearray.FromFile(SourceFile("switch_opcodes.bin"));

            Assert.AreEqual(r.Opcodes.Count, 4);
            Assert.AreEqual(r.Opcodes[0].Code, new byte[] { 83 });
            Assert.AreEqual(((SwitchBytearray.Opcode.Strval)(r.Opcodes[0].Body)).Value, "foobar");
            Assert.AreEqual(r.Opcodes[1].Code, new byte[] { 73 });
            Assert.AreEqual(((SwitchBytearray.Opcode.Intval)(r.Opcodes[1].Body)).Value, 66);
            Assert.AreEqual(r.Opcodes[2].Code, new byte[] { 73 });
            Assert.AreEqual(((SwitchBytearray.Opcode.Intval)(r.Opcodes[2].Body)).Value, 55);
            Assert.AreEqual(r.Opcodes[3].Code, new byte[] { 83 });
            Assert.AreEqual(((SwitchBytearray.Opcode.Strval)(r.Opcodes[3].Body)).Value, "");
        }
 public Intval(KaitaiStream p__io, SwitchBytearray.Opcode p__parent = null, SwitchBytearray p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root;
     _read();
 }
 public SwitchBytearray(KaitaiStream p__io, KaitaiStruct p__parent = null, SwitchBytearray p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root ?? this;
     _read();
 }