Method: HexaPDF::Filter.string_from_source
- Defined in:
- lib/hexapdf/filter.rb
.string_from_source(source) ⇒ Object
Returns the concatenated string chunks retrieved by resuming the given source Fiber until it is dead.
The returned string is always a string with binary (= ASCII-8BIT) encoding.
218 219 220 221 222 223 224 |
# File 'lib/hexapdf/filter.rb', line 218 def self.string_from_source(source) str = ''.b while source.alive? && (data = source.resume) str << data end str end |