code: @Override
  	public void add(BufferOrEvent boe) throws IOException {
  		try {
  			ByteBuffer contents;
  			if (boe.isBuffer()) {
  				Buffer buf = boe.getBuffer();
  				contents = buf.getNioBufferReadable();
  			}
  			else {
  				contents = EventSerializer.toSerializedEvent(boe.getEvent());
  			}
  
  			headBuffer.clear();
  			headBuffer.putInt(boe.getChannelIndex());
  			headBuffer.putInt(contents.remaining());
  			headBuffer.put((byte) (boe.isBuffer() ? 0 : 1));
  			headBuffer.flip();
  
  			bytesWritten += (headBuffer.remaining() + contents.remaining());
  
  			FileUtils.writeCompletely(currentChannel, headBuffer);
  			FileUtils.writeCompletely(currentChannel, contents);
  		}
  		finally {
  			if (boe.isBuffer()) {
  				boe.getBuffer().recycleBuffer();
  			}
  		}
  	}
docs: Adds a buffer or event to the sequence of spilled buffers and events.
  
  @param boe The buffer or event to add and spill.
  @throws IOException Thrown, if the buffer of event could not be spilled.