zoukankan      html  css  js  c++  java
  • Beanshell post processor写文件

    byte[] responseData = prev.getResponseData().;

    private String filePath = "F:/test.txt";

    BufferedOutputStream bos = null;

    FileOutputStream fos = null;

    File file = null;try

    {

    File file = new File(filePath);

    fos = new FileOutputStream(file, true);// 不添加参数true,以非追加的方式添加内容

    bos = new BufferedOutputStream(fos);

    bos.write(responseData);

    }catch(

    Exception e)

    {

    e.printStackTrace();

    }finally

    {

    if (bos != null) {

    try {

    bos.close();

    } catch (IOException e1) {

    e1.printStackTrace();

    }

    }

    if (fos != null) {

    try {

    fos.close();

    } catch (IOException e1) {

    e1.printStackTrace();

    }

    }

    }

     

        byte[] responseData = prev.getResponseData().;
        private String filePath = "F:/test.txt";
        BufferedOutputStream bos = null;
        FileOutputStream fos = null;
        File file = null;try
        {
            File file = new File(filePath);
            fos = new FileOutputStream(file, true);// 不添加参数true,以非追加的方式添加内容
            bos = new BufferedOutputStream(fos);
            bos.write(responseData);
        }catch(
        Exception e)
        {
            e.printStackTrace();
        }finally
        {
            if (bos != null) {
                try {
                    bos.close();
                } catch (IOException e1) {
                    e1.printStackTrace();
                }
            }
            if (fos != null) {
                try {
                    fos.close();
                } catch (IOException e1) {
                    e1.printStackTrace();
                }
            }
        }
    View Code
  • 相关阅读:
    线程池示例(摘抄)
    Visual Studio 相关
    Linq 内连接和外连接(转载)
    asp.net mvc4 简单使用Autofac依赖注入小结
    jquery加载解析XML文件
    权限验证AuthorizeAttribute
    常用SQL Server规范集锦及优化
    linq to datatable 和lambda查询datatable
    ASP.NET 大文件下载的实现思路及代码
    分页存储过程
  • 原文地址:https://www.cnblogs.com/a00ium/p/10360186.html
Copyright © 2011-2022 走看看