Module: ByteOrder

### Home Classes Methods

### In Files

- lib/byteorder.rb

### Methods

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

### Files

- 1q

### Class/Module Index

Quicksearch

- PostgresPR
- PostgresPR::Authentification
- PostgresPR::AuthentificationClearTextPassword
- PostgresPR::AuthentificationCryptPassword
- PostgresPR::AuthentificationKerberosV4
- PostgresPR::AuthentificationKerberosV5
- PostgresPR::AuthentificationMD5Password
- PostgresPR::AuthentificationOk
- PostgresPR::AuthentificationSCMCredential
- PostgresPR::BackendKeyData
- PostgresPR::CommandComplete
- PostgresPR::Connection
- PostgresPR::Connection::Result
- PostgresPR::CopyInResponse
- PostgresPR::CopyOutResponse
- PostgresPR::DataRow
- PostgresPR::DumpError
- PostgresPR::EmptyQueryResponse
- PostgresPR::ErrorResponse
- PostgresPR::Message
- PostgresPR::NoticeErrorMixin
- PostgresPR::NoticeResponse
- PostgresPR::ParameterStatus
- PostgresPR::Parse
- PostgresPR::ParseComplete
- PostgresPR::ParseError
- PostgresPR::PasswordMessage
- PostgresPR::Query
- PostgresPR::ReadyForQuery
- PostgresPR::RowDescription
- PostgresPR::RowDescription::FieldInfo
- PostgresPR::SSLRequest
- PostgresPR::SaltedAuthentificationMixin
- PostgresPR::StartupMessage
- PostgresPR::Terminate
- PostgresPR::UnknownAuthType
- PostgresPR::UnknownMessageType
- Buffer
- Buffer::EOF
- Buffer::Error
- Postgres
- Postgres::Conversion
- Postgres::Conversion::ConversionError
- BinaryReaderMixin
- BinaryWriterMixin
- ByteOrder
- IO
- PGError
- PGconn
- PGresult
- TC_Conversion

No matching classes.

# ByteOrder

### Constants

BigEndian
LittleEndian
Native

### Public Class Methods

big?() click to toggle source
Alias for: big_endian?
big_endian?() click to toggle source

    # File lib/byteorder.rb, line 21
    def big_endian?
      byte_order == BigEndian
    end

Also aliased as: big?, network?
byte_order() click to toggle source

examines the byte order of the underlying machine

    # File lib/byteorder.rb, line 7
    def byte_order
      if [0x12345678].pack("L") == "\x12\x34\x56\x78"
        BigEndian
      else
        LittleEndian
      end
    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/byteorder.rb, line 17
    def little_endian?
      byte_order == LittleEndian
    end

Also aliased as: little?
network?() click to toggle source
Alias for: big_endian?

[Validate]

Generated with the Darkfish Rdoc Generator 2.