Method: LZMA::Encoder#write

Defined in:
lib/extlzma2/encoder.rb

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



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/extlzma2/encoder.rb', line 14

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

  self
end