def each_with_number
            return enum_for(__method__) unless block_given?

            load! if @xrefs.nil?

            ranges = object_ranges
            xrefs = @xrefs.to_enum

            ranges.each do |range|
                range.each do |no|
                    begin
                        yield(xrefs.next, no)
                    rescue StopIteration
                        raise InvalidXRefStreamObjectError, "Range is bigger than number of entries"
                    end
                end
            end
        end
def each_with_number
            return enum_for(__method__) unless block_given?

            load! if @xrefs.nil?

            ranges = object_ranges
            xrefs = @xrefs.to_enum

            ranges.each do |range|
                range.each do |no|
                    begin
                        yield(xrefs.next, no)
                    rescue StopIteration
                        raise InvalidXRefStreamObjectError, "Range is bigger than number of entries"
                    end
                end
            end
        end
Iterates over each XRef present in the stream, passing the XRef and its object number.