Class | Origami::ObjectStream |
In: |
sources/parser/stream.rb
|
Parent: | Stream |
Class representing a Stream containing other Objects.
TODO Adds a new Object to this Stream.
object: | The Object to append. |
# File sources/parser/stream.rb, line 384 384: def <<(object) 385: 386: unless object.generation == 0 387: raise InvalidObject, "Cannot store an object with generation > 0 in an ObjectStream" 388: end 389: 390: if object.is_a?(Stream) 391: raise InvalidObject, "Cannot store a Stream in an ObjectStream" 392: end 393: 394: load! if @objects.nil? 395: 396: object.no, object.generation = @pdf.alloc_new_object_number if object.no == 0 397: 398: object.set_indirect(true) # object is indirect 399: object.parent = self # set this stream as the parent 400: object.set_pdf(@pdf) # indirect objects need pdf information 401: @objects[object.no] = object 402: 403: Reference.new(object.no, 0) 404: end