首页 > 系统服务 > 详细

Beanshell post processor写文件

时间:2019-02-10 21:01:22      阅读:241      评论:0      收藏:0      [点我收藏+]

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

 

Beanshell post processor写文件

原文:https://www.cnblogs.com/a00ium/p/10360186.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!