Exemplo n.º 1
0
 /// <summary>
 /// <para>Создает пакет с данными str1 и str2.</para>
 /// <para>Замечание: по умолчанию тип пакета - MESSAGE.</para>
 /// </summary>
 public Package(string str1, string str2 = null, Protocol.PackageType type = Protocol.PackageType.MESSAGE)
 {
     this.str1 = Protocol.commonEncoding.GetBytes(str1);
     if (str2 == null)
     {
         this.str2 = Protocol.commonEncoding.GetBytes("");
     }
     else
     {
         this.str2 = Protocol.commonEncoding.GetBytes(str2);
     }
     this.type = type;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Создает пустой пакет.
 /// </summary>
 private Package(int str1Size, int str2Size, Protocol.PackageType type)
 {
     str1      = new byte[str1Size];
     str2      = new byte[str2Size];
     this.type = type;
 }