module XDR::UnsignedInt

Public Class Methods

read(io) click to toggle source
# File lib/xdr/unsigned_int.rb, line 11
def self.read(io)
  read_bytes(io, 4).unpack("L>").first
end
write(val, io) click to toggle source
# File lib/xdr/unsigned_int.rb, line 5
def self.write(val, io)
  raise XDR::WriteError, "val is not Integer" unless val.is_a?(Integer)
  # TODO: check bounds
  io.write [val].pack("L>")
end