首页>代码>java图片开源框架tesseract调用OCR实现图片文件识别代码下载>/IdentityCardDiscern/src/com/handler/CardOutputHandler.java
                
                package com.handler;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
 * Image output class
 */
public class CardOutputHandler {
	
	//General output method
	public static void output(String inPath, String outPath) throws FileNotFoundException, IOException{
		FileInputStream fis = new FileInputStream(inPath);
		BufferedInputStream bis = new BufferedInputStream(fis);
		FileOutputStream fos = new FileOutputStream(outPath);
		BufferedOutputStream bos = new BufferedOutputStream(fos);
		int read;
		byte[] buffer = new byte[1024];
		while ((read = bis.read(buffer)) != -1) {
			bos.write(buffer, 0, read);
		}
		bos.flush();
		bos.close();
		fos.flush();
		fos.close();
		fis.close();
		bis.close();
		
	}
	
	public static void sucDiscernOutput(InputStream is, String sucPath) throws FileNotFoundException, IOException{
		output(is, sucPath);
	}
	
	public static void failDiscernOutput(InputStream is, String failPath) throws FileNotFoundException, IOException{
		output(is, failPath);
	}
	
	private static void output(InputStream is,String path) throws IOException,FileNotFoundException{
		BufferedInputStream bis = new BufferedInputStream(is);
		FileOutputStream fos = new FileOutputStream(path);
		BufferedOutputStream bos = new BufferedOutputStream(fos);
		int read;
		byte[] buffer = new byte[1024];
		while ((read = bis.read(buffer)) != -1) {
			bos.write(buffer, 0, read);
		}
		bos.flush();
		bos.close();
		fos.flush();
		fos.close();
		bis.close();
	}
}
 最近下载更多
最近下载更多
                
                okliu123456     LV24
                2021年12月14日
            
            
        
                zzs269285304     LV7
                2020年6月30日
            
            
        
                570662438     LV8
                2019年11月1日
            
            
        
                xtm123     LV18
                2019年10月12日
            
            
        
                CLATZJ     LV19
                2019年7月12日
            
            
        
                a278975044     LV7
                2019年5月18日
            
            
        
                tess123     LV1
                2019年5月17日
            
            
        
                fuxiyuan     LV6
                2019年5月8日
            
            
        
                913024733     LV15
                2019年4月16日
            
            
        
                zouzuofa     LV1
                2019年2月21日
            
            
         最近浏览更多
最近浏览更多
                
                lyn520     LV3
                4月24日
            
            
        
                星空Starry-Sky     LV6
                2024年3月1日
            
            
        
                tr1314qq     LV17
                2024年2月5日
            
            
        
                liyonggang     LV2
                2024年1月19日
            
            
        
                1837157674lgw    
                2023年11月13日
            
            
                    暂无贡献等级
            
        
                1257592068     LV6
                2023年9月18日
            
            
        
                huang163zi     LV1
                2023年4月26日
            
            
        
                微微笑的笑笑     LV3
                2023年4月11日
            
            
        
                我真的是小明     LV10
                2023年3月21日
            
            
        
                晴风8815     LV2
                2023年2月28日
            
            
        
 
                 
                 
                