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

相关文章:

  • 2021-08-01
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-03
  • 2022-01-05
  • 2022-12-23
  • 2021-08-17
  • 2022-01-14
相关资源
相似解决方案