本文整理了Java中org.apache.coyote.Response.doWrite
方法的一些代码示例,展示了Response.doWrite
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.doWrite
方法的具体详情如下:
包路径:org.apache.coyote.Response
类名称:Response
方法名:doWrite
[英]Write a chunk of bytes.
[中]写一大块字节。
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* 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);
}
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
/**
* 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);
}
}
}
代码示例来源:origin: org.jboss.web/jbossweb
/**
* 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);
}
}
}
代码示例来源:origin: jboss.web/jbossweb
/**
* 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);
}
}
}
代码示例来源:origin: tomcat/catalina
/**
* 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);
}
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
coyoteResponse.doWrite(outputChunk);
} catch (IOException e) {
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
coyoteResponse.doWrite(outputChunk);
} catch (IOException e) {
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
coyoteResponse.doWrite(outputChunk);
} catch (IOException e) {
代码示例来源:origin: codefollower/Tomcat-Research
coyoteResponse.doWrite(outputChunk);
} catch (IOException e) {
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
coyoteResponse.doWrite(outputChunk);
} catch (IOException e) {
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
coyoteResponse.doWrite(outputChunk);
} catch (IOException e) {
代码示例来源:origin: jboss.remoting/jboss-remoting
try
coyoteResponse.doWrite(outputChunk);
代码示例来源:origin: org.glassfish.metro/webservices-extra
while ((rd = fis.read(b)) > 0) {
chunk.setBytes(b, 0, rd);
res.doWrite(chunk);
代码示例来源:origin: org.jboss.web/jbossweb
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();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!