音乐 关注 标签
评论 参与 新评

 

package com.fh.controller.ruitai.util;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;

public class TomcatUtil {
    /**
     * @Description  读取文件
     * @author 张洋.
     * @date
     * @return
     * @throws ExceptionFile
     */
    public static String GetIdentified() throws Exception { // 
        File f = new File(TomcatUtil.class.getClassLoader().getResource("tomcatdentified.txt").getPath().replaceAll("%20", " "));
        FileInputStream input = new FileInputStream(f);
        BufferedInputStream buf = new BufferedInputStream(input);
        byte[] b = new byte[(int) f.length()];
        input.read(b);
        input.close();
        String identified=new String(b);
        return identified;
    }
        public static void main(String[] args) {
            try {
                GetIdentified();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
}

 

posted on 2017-02-26 23:05  ☠☚㊙☛☠  阅读(2284)  评论(0编辑  收藏  举报

Top
打赏

打赏

公众号