/** * 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 (response == null) return; // If we really have something to write if (cnt > 0) { // real write to the adapter outputChunk.setBytes(buf, off, cnt); try { response.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); } } }
res.doWrite(chunk);
while ((rd = fis.read(b)) > 0) { chunk.setBytes(b, 0, rd); res.doWrite(chunk);
while ((rd = fis.read(b)) > 0) { chunk.setBytes(b, 0, rd); res.doWrite(chunk);
while ((rd = fis.read(b)) > 0) { chunk.setBytes(b, 0, rd); res.doWrite(chunk);
while ((rd = fis.read(b)) > 0) { chunk.setBytes(b, 0, rd); res.doWrite(chunk);
ByteChunk chunk = new ByteChunk(); chunk.setBytes(b, 0, b.length); response.doWrite(chunk);