def build_xrefs(objects) #:nodoc:

            lastno = 0
            brange = 0

            xrefs = [ XRef.new(0, XRef::FIRSTFREE, XRef::FREE) ]

            xrefsection = XRef::Section.new
            objects.sort_by {|object| object.reference}
                   .each do |object|

                if (object.no - lastno).abs > 1
                    xrefsection << XRef::Subsection.new(brange, xrefs)
                    brange = object.no
                    xrefs.clear
                end

                xrefs << XRef.new(get_object_offset(object.no, object.generation), object.generation, XRef::USED)

                lastno = object.no
            end

            xrefsection << XRef::Subsection.new(brange, xrefs)

            xrefsection
        end
def build_xrefs(objects) #:nodoc:

            lastno = 0
            brange = 0

            xrefs = [ XRef.new(0, XRef::FIRSTFREE, XRef::FREE) ]

            xrefsection = XRef::Section.new
            objects.sort_by {|object| object.reference}
                   .each do |object|

                if (object.no - lastno).abs > 1
                    xrefsection << XRef::Subsection.new(brange, xrefs)
                    brange = object.no
                    xrefs.clear
                end

                xrefs << XRef.new(get_object_offset(object.no, object.generation), object.generation, XRef::USED)

                lastno = object.no
            end

            xrefsection << XRef::Subsection.new(brange, xrefs)

            xrefsection
        end
Build a xref section from a set of objects.