Cpper
C/C++高级工程师 Android高级软件工程师 IT集成工程师 音频工程师 熟悉c,c++,java,c#,py,js,asp等多种语言 程序猿
    public static String load(String name)
    {
        File file 
= new File(name);
        String buffer 
= new String();
        
if(!file.exists())
        { 
            System.out.println(
"can't find " + name);
        }

        
try 
        {
            BufferedReader reader 
= new BufferedReader(new FileReader(file));
            String line;
            
while((line = reader.readLine()) != null
            {
                buffer 
+= line;
            }
            reader.close();
        } 
        
catch (IOException e) 
        {
            e.getStackTrace();
        }
        
return buffer;
    }   
posted on 2013-01-19 22:33 ccsdu2009 阅读(377) 评论(0)  编辑 收藏 引用 所属分类: JAVA