code: public void copyFileFrom(InputStream src, boolean append) throws CopyFileFromException {
          ChannelSftp sftp;
  
          try {
              sftp = alloc();
              try {
                  sftp.put(src, escape(slashPath), append ? ChannelSftp.APPEND : ChannelSftp.OVERWRITE);
              } finally {
                  free(sftp);
              }
          } catch (SftpException | JSchException e) {
              throw new CopyFileFromException(this, e);
          }
      }
docs: This is the core function to write an ssh node. Does not close src.