Class: CZTop::Z85::Pipe::Strategy::Sequential
- Inherits:
-
CZTop::Z85::Pipe::Strategy
- Object
- CZTop::Z85::Pipe::Strategy
- CZTop::Z85::Pipe::Strategy::Sequential
- Defined in:
- lib/cztop/z85/pipe.rb
Overview
A single thread that is either reading input, encoding/decoding, or writing output.
Instance Method Summary collapse
-
#execute ⇒ Object
Runs the algorithm.
Methods inherited from CZTop::Z85::Pipe::Strategy
Constructor Details
This class inherits a constructor from CZTop::Z85::Pipe::Strategy
Instance Method Details
#execute ⇒ Object
Runs the algorithm.
102 103 104 105 106 107 108 109 110 111 |
# File 'lib/cztop/z85/pipe.rb', line 102 def execute previous_chunk = nil while true chunk = @source.read(@read_sz) @sink << @xcode.call(chunk, previous_chunk) break if chunk.nil? previous_chunk = chunk end end |