获取{@link ImageOutputStream}

@param outFile {@link File}
@return {@link ImageOutputStream}
@throws IORuntimeException IO异常
@since 3.2.2
977678
public static ImageOutputStream getImageOutputStream(File outFile) throws IORuntimeException {
		try {
			return ImageIO.createImageOutputStream(outFile);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
	}
1144630
public static File getImageFile(File inputFile) throws IOException {
        File imageFile = inputFile;
        if (inputFile.getName().toLowerCase().endsWith(".pdf")) {
            imageFile = PdfUtilities.convertPdf2Tiff(inputFile);
        }
        return imageFile;
    }
1154944
public static void cut(Image srcImage, OutputStream out, Rectangle rectangle) throws IORuntimeException {
		cut(srcImage, getImageOutputStream(out), rectangle);
	}
630537
protected OutputStream createOutputStream() throws IOException {
      if (asFile().isPresent()) {
         return new FileOutputStream(asFile().orElse(null));
      }
      return null;

   }
374081
public static String file(File file) throws IOException {
        FileInputStream fi = null;
        try {
            fi = new FileInputStream(file);
            return stream(fi, file.length());
        } finally {
            if (fi != null) {
                try {
                    fi.close();
                } catch (Throwable t) {
                }
            }
        }

    }
1065311
private static boolean encodeFileToFile(String infile, String outfile)
	{
		boolean success = false;
		java.io.InputStream in = null;
		java.io.OutputStream out = null;
		try
		{
			in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base64.ENCODE);
			out = new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
			byte[] buffer = new byte[65536]; // 64K
			int read = -1;
			while ((read = in.read(buffer)) >= 0)
			{
				out.write(buffer, 0, read);
			} // end while: through file
			success = true;
		}
		catch (java.io.IOException exc)
		{
		}
		finally
		{
			try
			{
				in.close();
			}
			catch (Exception exc)
			{
			}
			try
			{
				out.close();
			}
			catch (Exception exc)
			{
			}
		} // end finally

		return success;
	}
1092782
public static void copy(File file, OutputStream out) throws IOException {
    FileInputStream in = new FileInputStream(file);
    try {
      IOUtils.copy(new BufferedInputStream(in), out);
    }
    finally {
      IOUtils.closeQuietly(in);
    }
  }
1136882
public static void writeOut(BufferedImage image, OutputStream os, String format) throws IOException {
	ImageIO.write(image, format, os);

    }
1246359
public static File touch(File file) throws IORuntimeException {
		if (null == file) {
			return null;
		}
		if (false == file.exists()) {
			mkParentDirs(file);
			try {
				file.createNewFile();
			} catch (Exception e) {
				throw new IORuntimeException(e);
			}
		}
		return file;
	}
1330375
public OutputStream getOutputStream()
    throws IOException
  {
    if (_os == null)
      _os = new FileOutputStream(_file.getFD());

    return _os;
  }
5957
public File writeFromStream(InputStream in) throws IORuntimeException {
		FileOutputStream out = null;
		try {
			out = new FileOutputStream(FileUtil.touch(file));
			IoUtil.copy(in, out);
		}catch (IOException e) {
			throw new IORuntimeException(e);
		} finally {
			IoUtil.close(out);
		}
		return file;
	}
141828
public static void write(Image image, String imageType, OutputStream out) throws IORuntimeException {
		write(image, imageType, getImageOutputStream(out));
	}
1000109
public static void output(BufferedImage image, OutputStream out)
            throws IOException {
        ImageIO.write(image, "JPEG", out);
    }
1181221
public static BufferedImage read(InputStream imageStream) {
		try {
			return ImageIO.read(imageStream);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
	}
163911
public boolean write(File targetFile) throws IORuntimeException {
		final String formatName = FileUtil.extName(targetFile);
		if (StrUtil.isNotBlank(formatName)) {
			this.targetImageType = formatName;
		}
		
		if(targetFile.exists()) {
			targetFile.delete();
		}
		
		ImageOutputStream out = null;
		try {
			out = ImgUtil.getImageOutputStream(targetFile);
			return write(out);
		} finally {
			IoUtil.close(out);
		}
	}
1011522
public static void flip(File imageFile, File outFile) throws IORuntimeException {
		flip(read(imageFile), outFile);
	}
604710
public static void rotate(Image image, int degree, File outFile) throws IORuntimeException {
		write(rotate(image, degree), outFile);
	}