@Override
  public long writeTo(Write writeChannel) throws StoreException {
    if (exception != null) {
      throw exception;
    }
    long sizeWritten = 0;
    for (ByteBuffer buffer : buffers) {
      sizeWritten += buffer.remaining();
      writeChannel.appendFrom(Channels.newChannel(new ByteBufferInputStream(buffer)), buffer.remaining());
    }
    return sizeWritten;
  }
Reset the buffers so they can be written again.
ambry-store/src/test/java/com/github/ambry/store/MockMessageWriteSet.java