Method: LZMA::Encoder#write

Defined in:
lib/extlzma.rb

#write(buf) ⇒ Object Also known as: <<



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/extlzma.rb', line 161

def write(buf)
  writebuf.rewind
  writebuf.string.clear
  writebuf << buf
  until writebuf.string.empty?
    s = context.code(writebuf.string, workbuf, BLOCKSIZE, 0)
    unless s == 0
      Utils.raise_err s
    end
    outport << workbuf
    workbuf.clear
  end

  self
end