Sha256: 5c6b9b8d981bded01c92bba47166b3c0c441e466dd6195900a303e73f17470da

Contents?: true

Size: 583 Bytes

Versions: 73

Compression:

Stored size: 583 Bytes

Contents

require 'protobuf/field/uint64_field'

module Protobuf
  module Field
    class Fixed64Field < Uint64Field

      ##
      # Public Instance Methods
      #

      def decode(bytes)
        # we don't use 'Q' for pack/unpack. 'Q' is machine-dependent.
        values = bytes.unpack('VV')
        values[0] + (values[1] << 32)
      end

      def encode(value)
        # we don't use 'Q' for pack/unpack. 'Q' is machine-dependent.
        [value & 0xffff_ffff, value >> 32].pack('VV')
      end

      def wire_type
        ::Protobuf::WireType::FIXED64
      end

    end
  end
end

Version data entries

73 entries across 73 versions & 6 rubygems

Version Path
protobuf-3.10.9 lib/protobuf/field/fixed64_field.rb
protobuf-3.10.8 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.7.0 lib/protobuf/field/fixed64_field.rb
protobuf-3.10.7 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.6.5 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.6.4 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.6.3 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.6.2 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.6.1 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.6.0 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.5.1 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.5.0 lib/protobuf/field/fixed64_field.rb
contrast-agent-6.4.0 lib/protobuf/field/fixed64_field.rb
protobuf-3.10.6 lib/protobuf/field/fixed64_field.rb
protobuf-3.10.5 lib/protobuf/field/fixed64_field.rb
protobuf-3.10.4 lib/protobuf/field/fixed64_field.rb
protobuf-cucumber-3.10.8 lib/protobuf/field/fixed64_field.rb
protobuf-cucumber-3.10.7 lib/protobuf/field/fixed64_field.rb
protobuf-cucumber-3.10.6 lib/protobuf/field/fixed64_field.rb
protobuf-cucumber-3.10.5 lib/protobuf/field/fixed64_field.rb