Class: PacketGen::Types::Int64

Inherits:
Int
  • Object
show all
Defined in:
lib/packetgen/types/int.rb

Overview

8-byte unsigned integer

Author:

  • Sylvain Daubert

Direct Known Subclasses

Int64be, Int64le, Int64n, SInt64

Instance Attribute Summary

Attributes inherited from Int

#default, #endian, #value, #width

Instance Method Summary collapse

Methods inherited from Int

#format_inspect, #nbits, #read, #sz, #to_f, #to_i, #to_s

Methods included from Fieldable

#format_inspect, #read, #sz, #to_human, #to_s, #type_name

Constructor Details

#initialize(value = nil, endian = :big) ⇒ Int64

Returns a new instance of Int64.

Parameters:

  • value (Integer, nil) (defaults to: nil)
  • endian (:big, :little, :native) (defaults to: :big)


390
391
392
393
# File 'lib/packetgen/types/int.rb', line 390

def initialize(value=nil, endian=:big)
  super(value, endian, 8)
  @packstr = { big: 'Q>', little: 'Q<', native: 'Q' }
end