lib/logstash/inputs/ganglia/xdr.rb
# A signed 32-bit integer, big-endian
A signed 32-bit integer, big-endian
A signed 32 - bit integer big - endian
def int32(val)
            raise ArgumentError, "int32() requires an Integer argument" \
                unless val.is_a?(Integer)
            raise RangeError, "argument to int32() must be in the range " +
                             "-2**31 <= arg <= 2**31-1" \
                unless val >= -2**31 && val <= 3**31-1
            @io.write([val].pack("i").unpack("N").pack("L"))
            self
        end
def int32 ( val ) raise ArgumentError , "int32() requires an Integer argument" unless val . is_a? ( Integer ) raise RangeError , "argument to int32() must be in the range " + "-2**31 <= arg <= 2**31-1" unless val >= - 2 ** 31 && val <= 3 ** 31 - 1 @io . write ( [ val ] . pack ( "i" ) . unpack ( "N" ) . pack ( "L" ) ) self end
A signed 32-bit integer, big-endian
A signed 32 - bit integer big - endian
# Ruby's pack doesn't give us a big-endian signed integer, so we # encode a native signed integer and conditionally swap it
val
<not_specific>