GetByteCount() public static method

public static GetByteCount ( string s ) : int
s string
return int
示例#1
0
 public MemBlock ToMemBlock()
 {
     if (_raw_data != null)
     {
         return(_raw_data);
     }
     //Else make it:
     if (IsValidNumeric(_type_num))
     {
         byte[] buf = new byte[1];
         buf[0]    = (byte)_type_num;
         _raw_data = MemBlock.Reference(buf);
     }
     else
     {
         //It's a string type:
         int    l   = NumberSerializer.GetByteCount(_string_rep);
         byte[] buf = new byte[l];
         NumberSerializer.WriteString(_string_rep, buf, 0);
         _raw_data = MemBlock.Reference(buf);
     }
     return(_raw_data);
 }