private void flushBuffer() throws IOException {
		if(bufferIndex > 0) {
			SnappyCompressor.compress(buffer, 0, bufferIndex, cbuffer, effort);
			bufferIndex = 0;
			int l = cbuffer.getLength();
			while(l>0) {
				delegate.write(l >= 128 ? 0x80 | (l&0x7f) : l);
				l >>= 7;
			}
			delegate.write(cbuffer.getData(), 0, cbuffer.getLength());
		}
	}