docs: @SuppressWarnings("checkstyle:magicnumber")
  	public static void copy(InputStream in, int inSize, FileOutputStream out) throws IOException {
  		assert in != null;
  		assert out != null;
  		try (ReadableByteChannel inChannel = Channels.newChannel(in)) {
  			try (FileChannel outChannel = out.getChannel()) {
  				// apparently has trouble copying large files on Windows
  				if (inSize < 0 || OperatingSystem.WIN.isCurrentOS()) {
  					// magic number for Windows, 64Mb - 32Kb
  					final int maxCount = (64 * 1024 * 1024) - (32 * 1024);
  					long position = 0;
  					long copied = 1;
  					while ((inSize >= 0 && position < inSize) || (inSize < 0 && copied > 0)) {
  						copied = outChannel.transferFrom(inChannel, position, maxCount);
  						position += copied;
  					}
  				} else {
  					outChannel.transferFrom(inChannel, 0, inSize);
  				}
  			}
  		}
  	}