code: public Promise<Void> write(ByteBuf buf) {
  		return sanitize(ofBlockingRunnable(executor, () -> {
  			synchronized (mutexLock) {
  				try {
  					int writtenBytes;
  					do {
  						ByteBuffer byteBuffer = buf.toReadByteBuffer();
  						writtenBytes = channel.write(byteBuffer);
  						buf.ofReadByteBuffer(byteBuffer);
  					} while (writtenBytes != -1 && buf.canRead());
  				} catch (IOException e) {
  					throw new UncheckedException(e);
  				} finally {
  					buf.recycle();
  				}
  			}
  		}));
  	}
docs: Writes all bytes of the buffer into this file
  at its internal position asynchronously.
  
  @param buf byte buffer to be written