tree: 329ddb925a28f25b7af0fac35b0a6ef74441e823 [path history] [tgz]
  1. doc.go
  2. endian.go
  3. endian_test.go
  4. README.md
binary/endian/README.md

endian


import "android.googlesource.com/platform/tools/gpu/binary/endian"

Package endian implements binary.Reader and binary.Writer for writing .

Boolean values are encoded as single bytes, where 0 represents false and non- zero represents true.

Numeric types are all encoded as the simple native representation, but no attempt is made to align them.

Strings are encoded in C style null terminated form.

Usage

var (
	Little = ByteOrder(eb.LittleEndian)
	Big    = ByteOrder(eb.BigEndian)
)

func Reader

func Reader(r io.Reader, byteOrder ByteOrder) binary.Reader

Reader creates a binary.Reader that reads from the provided io.Reader, with the specified byte order.

func Writer

func Writer(w io.Writer, byteOrder ByteOrder) binary.Writer

Writer creates a binary.Writer that writes to the supplied stream, with the specified byte order.

type ByteOrder

type ByteOrder eb.ByteOrder