Documentation
¶
Overview ¶
Package binaryop -- encoding/binary パッケージについてのサンプルが配置されているパッケージです。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteOrder ¶
func ByteOrder() error
ByteOrder -- encoding/binary パッケージを用いて Go におけるバイトオーダーの確認をするサンプルです.
func NativeEndian ¶ added in v0.5.43
func NativeEndian() error
NativeEndian は、binary.NativeEndian のサンプルです。
encoding/binary には、バイトオーダーを扱う3つの変数が定義されている。
- binary.BigEndian : 最上位バイトから順に格納(ネットワークバイトオーダーとも呼ばれる)
- binary.LittleEndian : 最下位バイトから順に格納(x86/x86-64系CPUの標準)
- binary.NativeEndian : 実行環境のCPUに合わせたバイトオーダー
昨今のデスクトップ・サーバー向けCPU(x86/x86-64)はリトルエンディアンが標準であり、 ARMもiOS/Androidを含む多くの環境でリトルエンディアンモードで動作する。 そのため、NativeEndianはほぼリトルエンディアンと同義になるケースが多い。
NativeEndianの主な用途は、ローカルIPC(共有メモリ・パイプ等)のように 送受信が同一ホスト内で完結し、エンディアンを意識せずに記述したい場面で有用となる。 ネットワーク通信ではBigEndian(ネットワークバイトオーダー)を明示するのが原則。
REFERENCES ¶
func NewRegister ¶
NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。
func StructReadWrite ¶ added in v0.5.1
func StructReadWrite() error
StructReadWrite は、構造体をバイナリにパックし、それをバイナリとして書き出すサンプルです.
REFERENCES ¶
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.