def write(data)
      return nil if data.nil?
      @slicebuf ||= ""
      @inputproxy ||= StringIO.new
      @inputproxy.string = String(data)
      until @inputproxy.eof?
        slicesize = @blocksize - @buf.bytesize
        slicesize = @blocksize if slicesize > @blocksize
        @buf << @inputproxy.read(slicesize, @slicebuf)
        export_block if @buf.bytesize >= @blocksize
      end

      self
    end
def write(data)
      return nil if data.nil?
      @slicebuf ||= ""
      @inputproxy ||= StringIO.new
      @inputproxy.string = String(data)
      until @inputproxy.eof?
        slicesize = @blocksize - @buf.bytesize
        slicesize = @blocksize if slicesize > @blocksize
        @buf << @inputproxy.read(slicesize, @slicebuf)
        export_block if @buf.bytesize >= @blocksize
      end

      self
    end
call-seq:
   write(data) -> nil or self

 Write data to lz4 stream.

 If data is nil, return to process nothing.

 [RETURN (self)]
   Success write process.

 [RETURN (nil)]
   Given nil to data.

 [data (String)]