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; }
public static string ConvertToString(this GoBytes bytes) { return Encoding.UTF8.GetString(bytes.ConvertToBytes()); }