@Override public void writeBlock(Buffer buffer) throws IOException { addRequest(new BufferWriteRequest(this, buffer)); }
/** * Writes the given block asynchronously. * * @param buffer * the buffer to be written (will be recycled when done) * * @throws IOException * thrown if adding the write operation fails */ @Override public void writeBlock(Buffer buffer) throws IOException { try { // if successfully added, the buffer will be recycled after the write operation if (withHeader) { addRequest(new BufferWriteRequest(this, buffer, bufferSize)); } else { addRequest(new StreamWriteRequest(this, buffer, bufferSize)); } } catch (Throwable e) { // if not added, we need to recycle here buffer.recycleBuffer(); ExceptionUtils.rethrowIOException(e); } }
/** * Writes the given block asynchronously. * * @param buffer * the buffer to be written (will be recycled when done) * * @throws IOException * thrown if adding the write operation fails */ @Override public void writeBlock(Buffer buffer) throws IOException { try { // if successfully added, the buffer will be recycled after the write operation addRequest(new BufferWriteRequest(this, buffer)); } catch (Throwable e) { // if not added, we need to recycle here buffer.recycleBuffer(); ExceptionUtils.rethrowIOException(e); } }
/** * Writes the given block asynchronously. * * @param buffer * the buffer to be written (will be recycled when done) * * @throws IOException * thrown if adding the write operation fails */ @Override public void writeBlock(Buffer buffer) throws IOException { try { // if successfully added, the buffer will be recycled after the write operation addRequest(new BufferWriteRequest(this, buffer)); } catch (Throwable e) { // if not added, we need to recycle here buffer.recycleBuffer(); ExceptionUtils.rethrowIOException(e); } }