Sha256: aa1095c65aa7165d8d8aa76c915c8a904a694b39841c192ba0428a1c6176928d

Contents?: true

Size: 617 Bytes

Versions: 2

Compression:

Stored size: 617 Bytes

Contents

# frozen_string_literal: true

require "binary_plist/parser/object_readers/base"

module BinaryPList
  module Parser
    module ObjectReaders
      class Int < Base
        def self.reads?(marker)
          (0b0001_0000..0b0001_1111).include?(marker)
        end

        def read(marker)
          raise UnsupportedMarkerError, marker unless self.class.reads?(marker)

          marker_length = marker & 0xF

          bytes_count = (1 << marker_length)
          # raise OffsetOutOfRangeError if outside_object_table?(io.tell + bytes_count)

          read_int(bytes_count)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
binary_plist-parser-0.1.1 lib/binary_plist/parser/object_readers/int.rb
binary_plist-parser-0.1.0 lib/binary_plist/parser/object_readers/int.rb