code: public long copyFileToImpl(OutputStream dest, long skip) throws FileNotFoundException, CopyFileToException {
          long result;
  
          try (InputStream src = newInputStream()) {
              if (skip(src, skip)) {
                  return 0;
              }
              result = getWorld().getBuffer().copy(src, dest);
          } catch (FileNotFoundException e) {
              throw e;
          } catch (IOException e) {
              throw new CopyFileToException(this, e);
          }
          return result;
      }
docs: /* copyFileTo implementation with streams