/** * Sends the buffer data to the client output, checking the * state of Response and calling the right interceptors. * * @param buf the ByteBuffer to be written to the response * * @throws IOException An underlying IOException occurred */ public void realWriteBytes(ByteBuffer buf) throws IOException { if (closed) { return; } if (coyoteResponse == null) { return; } // If we really have something to write if (buf.remaining() > 0) { // real write to the adapter try { coyoteResponse.doWrite(buf); } catch (IOException e) { // An IOException on a write is almost always due to // the remote client aborting the request. Wrap this // so that it can be handled better by the error dispatcher. throw new ClientAbortException(e); } } }
/** * Sends the buffer data to the client output, checking the * state of Response and calling the right interceptors. * * @param buf the ByteBuffer to be written to the response * * @throws IOException An underlying IOException occurred */ public void realWriteBytes(ByteBuffer buf) throws IOException { if (closed) { return; } if (coyoteResponse == null) { return; } // If we really have something to write if (buf.remaining() > 0) { // real write to the adapter try { coyoteResponse.doWrite(buf); } catch (IOException e) { // An IOException on a write is almost always due to // the remote client aborting the request. Wrap this // so that it can be handled better by the error dispatcher. throw new ClientAbortException(e); } } }
/** * Sends the buffer data to the client output, checking the * state of Response and calling the right interceptors. * * @param buf Byte buffer to be written to the response * @param off Offset * @param cnt Length * * @throws IOException An underlying IOException occurred */ public void realWriteBytes(byte buf[], int off, int cnt) throws IOException { if (closed) return; if (coyoteResponse == null) return; // If we really have something to write if (cnt > 0) { // real write to the adapter outputChunk.setBytes(buf, off, cnt); try { coyoteResponse.doWrite(outputChunk); } catch (IOException e) { // An IOException on a write is almost always due to // the remote client aborting the request. Wrap this // so that it can be handled better by the error dispatcher. throw new ClientAbortException(e); } } }
/** * Sends the buffer data to the client output, checking the * state of Response and calling the right interceptors. * * @param buf Byte buffer to be written to the response * @param off Offset * @param cnt Length * * @throws IOException An underlying IOException occurred */ public void realWriteBytes(byte buf[], int off, int cnt) throws IOException { if (closed) return; if (coyoteResponse == null) return; // If we really have something to write if (cnt > 0) { // real write to the adapter outputChunk.setBytes(buf, off, cnt); try { coyoteResponse.doWrite(outputChunk); } catch (IOException e) { // An IOException on a write is almost always due to // the remote client aborting the request. Wrap this // so that it can be handled better by the error dispatcher. throw new ClientAbortException(e); } } }
/** * Sends the buffer data to the client output, checking the * state of Response and calling the right interceptors. * * @param buf Byte buffer to be written to the response * @param off Offset * @param cnt Length * * @throws IOException An underlying IOException occurred */ public void realWriteBytes(byte buf[], int off, int cnt) throws IOException { if (closed) return; if (coyoteResponse == null) return; // If we really have something to write if (cnt > 0) { // real write to the adapter outputChunk.setBytes(buf, off, cnt); try { coyoteResponse.doWrite(outputChunk); } catch (IOException e) { // An IOException on a write is almost always due to // the remote client aborting the request. Wrap this // so that it can be handled better by the error dispatcher. throw new ClientAbortException(e); } } }
coyoteResponse.doWrite(outputChunk); } catch (IOException e) {
coyoteResponse.doWrite(outputChunk); } catch (IOException e) {
coyoteResponse.doWrite(outputChunk); } catch (IOException e) {
coyoteResponse.doWrite(outputChunk); } catch (IOException e) {
coyoteResponse.doWrite(outputChunk); } catch (IOException e) {
coyoteResponse.doWrite(outputChunk); } catch (IOException e) {
try coyoteResponse.doWrite(outputChunk);
while ((rd = fis.read(b)) > 0) { chunk.setBytes(b, 0, rd); res.doWrite(chunk);
private void writeBytes(byte b[], int off, int len) throws IOException { if (closed) return; if (response.getRequest().getUpgradeHandler() != null) { // If we really have something to write if (len > 0) { // real write to the adapter ByteChunk output = new ByteChunk(); output.setBytes(b, off, len); try { coyoteResponse.doWrite(output); } catch (IOException e) { // An IOException on a write is almost always due to // the remote client aborting the request. Wrap this // so that it can be handled better by the error dispatcher. throw new ClientAbortException(e); } } } else { bb.append(b, off, len); bytesWritten += len; // if called from within flush(), then immediately flush // remaining bytes if (doFlush) { bb.flushBuffer(); } } }