Platform::ByteOrder

Copyright © 2003 Michael Neumann

Constants

Native
BigEndian
LittleEndian

Public Class Methods

big?() click to toggle source
Alias for: big_endian?
big_endian?() click to toggle source
     # File lib/more/facets/platform.rb, line 225
225:     def big_endian?
226:       byte_order == BigEndian
227:     end
Also aliased as: big?, network?
byte_order() click to toggle source

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
Also aliased as: byteorder
byteorder() click to toggle source
Alias for: byte_order
little?() click to toggle source
Alias for: little_endian?
little_endian?() click to toggle source
     # File lib/more/facets/platform.rb, line 221
221:     def little_endian?
222:       byte_order == LittleEndian
223:     end
Also aliased as: little?
network?() click to toggle source
Alias for: big_endian?

Private Instance Methods

big?() click to toggle source
Alias for: big_endian?
big_endian?() click to toggle source
     # File lib/more/facets/platform.rb, line 225
225:     def big_endian?
226:       byte_order == BigEndian
227:     end
Also aliased as: big?, network?
byte_order() click to toggle source

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
Also aliased as: byteorder
byteorder() click to toggle source
Alias for: byte_order
little?() click to toggle source
Alias for: little_endian?
little_endian?() click to toggle source
     # File lib/more/facets/platform.rb, line 221
221:     def little_endian?
222:       byte_order == LittleEndian
223:     end
Also aliased as: little?
network?() click to toggle source
Alias for: big_endian?

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.