org.kohsuke.stapler.framework.io.ByteBuffer.writeTo()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中org.kohsuke.stapler.framework.io.ByteBuffer.writeTo()方法的一些代码示例,展示了ByteBuffer.writeTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.writeTo()方法的具体详情如下:
包路径:org.kohsuke.stapler.framework.io.ByteBuffer
类名称:ByteBuffer
方法名:writeTo

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);
  }
}

相关文章