Module: Platform::ByteOrder

Module | Platform::ByteOrder
In: | lib/more/facets/platform.rb

Copyright (c) 2003 Michael Neumann

### Methods

big? big_endian? byte_order byteorder little? little_endian? network?

### Constants

Native | = | :Native
BigEndian | = | Big = Network = :BigEndian
LittleEndian | = | Little = :LittleEndian

### Public Instance methods

big?()

Alias for big_endian?

big_endian?()

[Source]

    # File lib/more/facets/platform.rb, line 225
        def big_endian?
          byte_order == BigEndian
        end

byte_order()

examines the byte order of the underlying machine

[Source]

    # File lib/more/facets/platform.rb, line 211
        def byte_order
          if [0x12345678].pack("L") == "\x12\x34\x56\x78"
            BigEndian
          else
            LittleEndian
          end
        end

byteorder()

Alias for byte_order

little?()

Alias for little_endian?

little_endian?()

[Source]

    # File lib/more/facets/platform.rb, line 221
        def little_endian?
          byte_order == LittleEndian
        end

network?()

Alias for big_endian?

[Validate]