本文整理了Java中org.kohsuke.stapler.framework.io.ByteBuffer.writeTo()
方法的一些代码示例,展示了ByteBuffer.writeTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.writeTo()
方法的具体详情如下:
包路径:org.kohsuke.stapler.framework.io.ByteBuffer
类名称:ByteBuffer
方法名:writeTo
[英]Writes the contents of this buffer to another OutputStream.
[中]将此缓冲区的内容写入另一个OutputStream。
代码示例来源:origin: org.jvnet.hudson.plugins/clearcase
/**
* Displays "cleartool -version" for trouble shooting.
*/
public void doVersion(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
ByteBuffer baos = new ByteBuffer();
try {
Hudson.getInstance().createLauncher(TaskListener.NULL).launch().cmds(getCleartoolExe(), "-version").stdout(baos).join();
rsp.setContentType("text/plain");
baos.writeTo(rsp.getOutputStream());
} catch (IOException e) {
req.setAttribute("error", e);
rsp.forward(this, "versionCheckError", req);
}
}
代码示例来源:origin: org.hudsonci.plugins/cvs
/**
* Displays "cvs --version" for trouble shooting.
*/
public void doVersion(StaplerRequest req, StaplerResponse rsp)
throws IOException, ServletException, InterruptedException {
ByteBuffer baos = new ByteBuffer();
try {
Hudson.getInstance().createLauncher(TaskListener.NULL).launch()
.cmds(getCvsExeOrDefault(), "--version").stdout(baos).join();
rsp.setContentType("text/plain");
baos.writeTo(rsp.getOutputStream());
} catch (IOException e) {
req.setAttribute("error", e);
rsp.forward(this, "versionCheckError", req);
}
}
代码示例来源:origin: org.jvnet.hudson.plugins/cvs
/**
* Displays "cvs --version" for trouble shooting.
*/
public void doVersion(StaplerRequest req, StaplerResponse rsp)
throws IOException, ServletException, InterruptedException {
ByteBuffer baos = new ByteBuffer();
try {
Hudson.getInstance().createLauncher(TaskListener.NULL).launch()
.cmds(getCvsExeOrDefault(), "--version").stdout(baos).join();
rsp.setContentType("text/plain");
baos.writeTo(rsp.getOutputStream());
} catch (IOException e) {
req.setAttribute("error", e);
rsp.forward(this, "versionCheckError", req);
}
}
内容来源于网络,如有侵权,请联系作者删除!