docs: public static int copyStreamCount(final InputStream in, final OutputStream out) throws IOException {
          final byte[] buffer = new byte[10240];
          int tot=0;
          int c;
          c = in.read(buffer);
          while (c >= 0) {
              if (c > 0) {
                  out.write(buffer, 0, c);
                  tot += c;
              }
              c = in.read(buffer);
          }
          return tot;
      }