Module: GorgonAMQ::Endianness

Extended by:
Endianness
Included in:
Endianness
Defined in:
lib/gorgon_amq-protocol/lib/gorgon_amq/endianness.rb

Constant Summary collapse

BIG_ENDIAN =
([1].pack("s") == "\x00\x01")

Instance Method Summary collapse

Instance Method Details

#big_endian?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/endianness.rb', line 5

def big_endian?
  BIG_ENDIAN
end

#little_endian?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/endianness.rb', line 9

def little_endian?
  !BIG_ENDIAN
end