public static void copy(@NotNull InputStream inputStream, long maxSize, @NotNull OutputStream outputStream) throws IOException {
    byte[] buffer = new byte[StreamUtil.BUFFER_SIZE];
    long toRead = maxSize;
    while (toRead > 0) {
      int read = inputStream.read(buffer, 0, (int)Math.min(buffer.length, toRead));
      if (read < 0) break;
      toRead -= read;
      outputStream.write(buffer, 0, read);
    }
  }
public static void copy(@NotNull InputStream inputStream, long maxSize, @NotNull OutputStream outputStream)