public Tlv(TlvType type, Int32 value) : this(type, (UInt32)value) { }
public Tlv Add(TlvType type, Int64 value) { return(this.Add(new Tlv(type, (UInt64)value))); }
public Tlv AddGroup(TlvType type) { return(this.Add(new Tlv(type))); }
public Tlv Add(TlvType type, byte[] value, int size) { return(this.Add(new Tlv(type, value, size))); }
public Tlv Add(TlvType type, UInt32 value) { return(this.Add(new Tlv(type, value))); }
public Tlv(TlvType type) : this() { this.Type = type; }
public void Pack(TlvType t, bool b) { ValidateMetaType(MetaType.Bool, t); Append(t, b ? new byte[] { 1 } : new byte[] { 0 }); }
private static MetaType TlvTypeToMetaType(TlvType tlvType) { return((MetaType)((int)tlvType & (int)MetaType.All)); }
public Tlv Add(TlvType type, PacketResult value) { return(this.Add(new Tlv(type, (UInt32)value))); }
public void Pack(TlvType t, byte[] value) { ValidateMetaType(MetaType.Raw, t); Append(t, value); }
private void Append(TlvType t, byte[] value) { Append(_stream, t, value); }
public void Pack(TlvType t, string s) { ValidateMetaType(MetaType.String, t); Append(t, ToBytes(s)); }
public void Pack(TlvType t, Int64 i) { ValidateMetaType(MetaType.Qword, t); Append(t, ToBytes(i)); }
public void Pack(TlvType t, int i) { ValidateMetaType(MetaType.Uint, t); Append(t, ToBytes(i)); }
public Tlv(TlvType type, Int64 value) : this(type, (UInt64)value) { }
public Tlv Add(TlvType type, string value) { return(this.Add(new Tlv(type, value))); }
public Tlv AddGroup(TlvType type) { ValidateMetaType(MetaType.Group); return(this.Add(new Tlv(type))); }
public Tlv Add(TlvType type, bool value) { return(this.Add(new Tlv(type, value))); }
public Tlv Add(TlvType type, UInt64 value) { ValidateMetaType(MetaType.Group); return(this.Add(new Tlv(type, value))); }
public static void WriteTlvType(this BinaryWriter writer, TlvType type) { writer.WriteDword((UInt32)type); }