public static string BufferToString(byte* b, int length) { return new string((sbyte*)b, 0, length, Encoding.ASCII).TrimEnd('\0'); }