class PDF::Reader::Stream


compression, etc) and a stream of bytes.
objects have 2 components, a dictionary that describes the content (size,
An internal PDF::Reader class that represents a stream object from a PDF. Stream
###############################################################################

def initialize(hash, data)

should be a standard ruby hash, the data should be a standard ruby string.
Creates a new stream with the specified dictionary and data. The dictionary
###############################################################################
def initialize(hash, data)
  @hash = TypeCheck.cast_to_pdf_dict!(hash)
  @data = data
  @udata = nil
end

def unfiltered_data

apply this streams filters to its data and return the result.
###############################################################################
def unfiltered_data
  return @udata if @udata
  @udata = data.dup
  if hash.has_key?(:Filter)
    options = []
    if hash.has_key?(:DecodeParms)
      if hash[:DecodeParms].is_a?(Hash)
        options = [hash[:DecodeParms]]
      else
        options = hash[:DecodeParms]
      end
    end
    Array(hash[:Filter]).each_with_index do |filter, index|
      @udata = Filter.with(filter, options[index] || {}).filter(@udata)
    end
  end
  @udata
end