`

如何以流保存大字段Body

 
阅读更多
 AffixFile af = new AffixFile(); 
 File file = new File(dir, name);
            try {
                byte[] buffer = new byte[(int) file.length()];
                FileInputStream inputStream = new FileInputStream(file);
                inputStream.read(buffer);
                inputStream.close();
                af.setBody(buffer);
                af.setSize(file.length());
            } catch (Exception e) {
                e.printStackTrace();
            }

 dir:文件路径

 name:文件名称

0
1
分享到:
评论
1 楼 mercyblitz 2010-06-17  
AffixFile?

什么意思?

相关推荐

Global site tag (gtag.js) - Google Analytics