code: public long copyFileFromImpl(InputStream src) throws FileNotFoundException, CopyFileFromException {
          try (OutputStream dest = newOutputStream()) {
              return getWorld().getBuffer().copy(src, dest);
          } catch (FileNotFoundException e) {
              throw e;
          } catch (IOException e) {
              throw new CopyFileFromException(this, e);
          }
      }
docs: /* copyFileFrom implementation with streams