Exemple #1
0
        public static byte[] ConvertToBytes(this GoBytes goBytes)
        {
            int length = goBytes.Length.ToInt32();
            byte[] bytes = new byte[length];
            for (int i = 0; i < length; i++)
            {
                bytes[i] = Marshal.ReadByte(goBytes.Data, i);
            }

            return bytes;
        }
Exemple #2
0
 public static string ConvertToString(this GoBytes bytes)
 {
     return Encoding.UTF8.GetString(bytes.ConvertToBytes());
 }