zoukankan      html  css  js  c++  java
  • 把字节数组保存为一个文件

    /** 

         * 把字节数组保存为一个文件  

         * @EditTime 2007-8-13 上午11:45:56  

         */   

        public static File getFileFromBytes(byte[] b, String outputFile) {   

            BufferedOutputStream stream = null;   

            File file = null;   

            try {   

                file = new File(outputFile);   

                FileOutputStream fstream = new FileOutputStream(file);   

                stream = new BufferedOutputStream(fstream);   

                stream.write(b);   

            } catch (Exception e) {   

                e.printStackTrace();   

            } finally {   

                if (stream != null) {   

                    try {   

                        stream.close();   

                    } catch (IOException e1) {   

                        e1.printStackTrace();   

                    }   

                }   

            }   

            return file;   

        }   

  • 相关阅读:
    Apache安装与属性配置
    Web服务及http协议
    转-httpd 2.4.4 + mysql-5.5.28 + php-5.4.13编译安装过程
    LAMP理论整理
    Rhel6-csync配置文档
    转载Eclipse中Maven WEB工程tomcat项目添加调试
    转载--eclipse git插件安装
    l连接远程桌面
    Aphache VFS
    JMS-activeMQ
  • 原文地址:https://www.cnblogs.com/zhwl/p/2262079.html
Copyright © 2011-2022 走看看