Module | Platform::ByteOrder |
In: |
lib/more/facets/platform.rb
|
Copyright (c) 2003 Michael Neumann
Native | = | :Native |
BigEndian | = | Big = Network = :BigEndian |
LittleEndian | = | Little = :LittleEndian |
# File lib/more/facets/platform.rb, line 225 225: def big_endian? 226: byte_order == BigEndian 227: end
examines the byte order of the underlying machine
# File lib/more/facets/platform.rb, line 211 211: def byte_order 212: if [0x12345678].pack("L") == "\x12\x34\x56\x78" 213: BigEndian 214: else 215: LittleEndian 216: end 217: end