module Platform::ByteOrder
Copyright © 2003 Michael Neumann
Constants
- BigEndian
- LittleEndian
- Native
Public Class Methods
big_endian?()
click to toggle source
# File lib/more/facets/platform.rb, line 225 def big_endian? byte_order == BigEndian end
byte_order()
click to toggle source
examines the byte order of the underlying machine
# File lib/more/facets/platform.rb, line 211 def byte_order if [0x12345678].pack("L") == "\x12\x34\x56\x78" BigEndian else LittleEndian end end
Also aliased as: byteorder
little_endian?()
click to toggle source
# File lib/more/facets/platform.rb, line 221 def little_endian? byte_order == LittleEndian end
Also aliased as: little?
Private Instance Methods
big_endian?()
click to toggle source
# File lib/more/facets/platform.rb, line 225 def big_endian? byte_order == BigEndian end
byte_order()
click to toggle source
examines the byte order of the underlying machine
# File lib/more/facets/platform.rb, line 211 def byte_order if [0x12345678].pack("L") == "\x12\x34\x56\x78" BigEndian else LittleEndian end end
Also aliased as: byteorder
little_endian?()
click to toggle source
# File lib/more/facets/platform.rb, line 221 def little_endian? byte_order == LittleEndian end
Also aliased as: little?