public void execute()

in deploy-runner-agent/src/main/java/jetbrains/buildServer/deployer/agent/ssh/scp/FileScpOperation.java [117:143]


  public void execute(@NotNull final OutputStream out,
                      @NotNull final InputStream in) throws IOException {
    final String command = "C0"+ getPermission() + " " + myFile.length() + " " + myFile.getName() + "\n";
    out.write(command.getBytes());
    out.flush();
    ScpExecUtil.checkScpAck(in);

    // send the content
    FileInputStream fis = null;
    byte[] buf = new byte[1024];
    try {
      fis = new FileInputStream(myFile);
      while (true) {
        int len = fis.read(buf, 0, buf.length);
        if (len <= 0) break;
        out.write(buf, 0, len); //out.flush();
      }
    } finally {
      FileUtil.close(fis);
    }

    // send '\0'
    buf[0] = 0;
    out.write(buf, 0, 1);
    out.flush();
    ScpExecUtil.checkScpAck(in);
  }