Exemple #1
0
 public Tlv(TlvType type, Int32 value)
     : this(type, (UInt32)value)
 {
 }
Exemple #2
0
 public Tlv Add(TlvType type, Int64 value)
 {
     return(this.Add(new Tlv(type, (UInt64)value)));
 }
Exemple #3
0
 public Tlv AddGroup(TlvType type)
 {
     return(this.Add(new Tlv(type)));
 }
Exemple #4
0
 public Tlv Add(TlvType type, byte[] value, int size)
 {
     return(this.Add(new Tlv(type, value, size)));
 }
Exemple #5
0
 public Tlv Add(TlvType type, UInt32 value)
 {
     return(this.Add(new Tlv(type, value)));
 }
Exemple #6
0
 public Tlv(TlvType type)
     : this()
 {
     this.Type = type;
 }
Exemple #7
0
 public void Pack(TlvType t, bool b)
 {
     ValidateMetaType(MetaType.Bool, t);
     Append(t, b ? new byte[] { 1 } : new byte[] { 0 });
 }
Exemple #8
0
 private static MetaType TlvTypeToMetaType(TlvType tlvType)
 {
     return((MetaType)((int)tlvType & (int)MetaType.All));
 }
Exemple #9
0
 public Tlv Add(TlvType type, PacketResult value)
 {
     return(this.Add(new Tlv(type, (UInt32)value)));
 }
Exemple #10
0
 public void Pack(TlvType t, byte[] value)
 {
     ValidateMetaType(MetaType.Raw, t);
     Append(t, value);
 }
Exemple #11
0
 private void Append(TlvType t, byte[] value)
 {
     Append(_stream, t, value);
 }
Exemple #12
0
 public void Pack(TlvType t, string s)
 {
     ValidateMetaType(MetaType.String, t);
     Append(t, ToBytes(s));
 }
Exemple #13
0
 public void Pack(TlvType t, Int64 i)
 {
     ValidateMetaType(MetaType.Qword, t);
     Append(t, ToBytes(i));
 }
Exemple #14
0
 public void Pack(TlvType t, int i)
 {
     ValidateMetaType(MetaType.Uint, t);
     Append(t, ToBytes(i));
 }
Exemple #15
0
 public Tlv(TlvType type, Int64 value)
     : this(type, (UInt64)value)
 {
 }
Exemple #16
0
 public Tlv Add(TlvType type, string value)
 {
     return(this.Add(new Tlv(type, value)));
 }
Exemple #17
0
 public Tlv AddGroup(TlvType type)
 {
     ValidateMetaType(MetaType.Group);
     return(this.Add(new Tlv(type)));
 }
Exemple #18
0
 public Tlv Add(TlvType type, bool value)
 {
     return(this.Add(new Tlv(type, value)));
 }
Exemple #19
0
 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);
 }