Skip to content

Instantly share code, notes, and snippets.

@MartinZikmund
Created January 6, 2019 07:58
Show Gist options
  • Save MartinZikmund/884ca1f12db291089140c33d16213b00 to your computer and use it in GitHub Desktop.
Save MartinZikmund/884ca1f12db291089140c33d16213b00 to your computer and use it in GitHub Desktop.
First (wrong) approach for converting two little-endian bytes to ushort
var result = (ushort)(data[position + 1] << 8 + data[position]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment