Method: ByteOrder.byteorder
- Defined in:
- lib/carat/byteorder.rb
.byteorder ⇒ Object
examines the byte order of the underlying machine
17 18 19 20 21 22 23 |
# File 'lib/carat/byteorder.rb', line 17 def byte_order if [0x12345678].pack("L") == "\x12\x34\x56\x78" BigEndian else LittleEndian end end |