0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

バイトオーダー > little endian / big endian > 判別用変数 > 1を入れておいて判別

Last updated at Posted at 2015-08-23

引用: オンラインゲームのしくみ: Unityで覚えるネットワークプログラミング by 河田匡稔(まさとし)さん
7.4 プログラムを動かしてみよう

  • エンディアンの判定
    変数endianに判別用の数値1を代入します。このendianをBitConverterクラスでbyte[]型の値に変換します。このとき、ビッグエンディアンであれば最上位4バイトは0になっています。リトルエンディアンであればメモリ配置順が逆になるので、最上位バイトは1になっています。
ビッグエンディアン 00 00 00 01
リトルエンディアン 01 00 00 00
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?