no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | development:csharp:converting_bytes [2021/05/20 20:22] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== C# Reading from and writing to byte array ====== | ||
+ | <code c#> | ||
+ | Byte[] ByteName = new Byte[101]; | ||
+ | Buffer.BlockCopy(bytes, | ||
+ | string Name = Encoding.UTF8.GetString(ByteName).TrimEnd(' | ||
+ | bytes[100] | ||
+ | BitConverter.ToUInt16(bytes, | ||
+ | BitConverter.ToUInt32(bytes, | ||
+ | BitConverter.ToUInt32(bytes, | ||
+ | | ||
+ | string name = " | ||
+ | |||
+ | BitConverter.GetBytes(bool); | ||
+ | Encoding.ASCII.GetBytes(string) | ||
+ | </ |