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

Copyright (c) 2003 Michael Neumann

Methods

Constants

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

Public Instance methods

big?()

Alias for big_endian?

[Source]

     # 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

[Source]

     # 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
byteorder()

Alias for byte_order

little?()

Alias for little_endian?

[Source]

     # File lib/more/facets/platform.rb, line 221
221:     def little_endian?
222:       byte_order == LittleEndian
223:     end
network?()

Alias for big_endian?

[Validate]