Example #1
0
 public void FromBase64String(string value)
 {
     try
     {
         byte[] array = Convert.FromBase64String(value);
         this.Import(array, 0, array.Length);
     }
     catch (Exception innerexception)
     {
         throw NetTcpException.StringEncodingError(innerexception);
     }
 }
Example #2
0
 public void Encoding(string value, Encoding coding)
 {
     try
     {
         if (string.IsNullOrEmpty(value))
         {
             this.SetInfo(0, 0);
         }
         else
         {
             int bytes = coding.GetBytes(value, 0, value.Length, this.Array, 0);
             this.SetInfo(0, bytes);
         }
     }
     catch (Exception innerexception)
     {
         throw NetTcpException.StringEncodingError(innerexception);
     }
 }