class HexaPDF::StreamData
def initialize(source = nil, offset: nil, length: nil, filter: nil, decode_parms: nil, &block)
* A Proc object (that is converted to a Fiber when needed) in which case the +offset+ and
* and for a specific +length+
* A string which is interpreted as a file name and read starting from a specific +offset+
* An IO stream which is read starting from a specific +offset+ for a specific +length+
The +source+ can be:
Creates a new StreamData object for the given +source+ and with the given options.
StreamData.new { block } -> stream_data
StreamData.new(proc) -> stream_data
StreamData.new(str) -> stream_data
StreamData.new(io) -> stream_data
:call-seq:
def initialize(source = nil, offset: nil, length: nil, filter: nil, decode_parms: nil, &block) if source.nil? && !block_given? raise ArgumentError, "Either a source object or a block must be given" end @source = source || block @offset = offset @length = length @filter = [filter].flatten.compact @decode_parms = [decode_parms].flatten freeze end