Skip to content

Commit

Permalink
fix: 兼容java8
Browse files Browse the repository at this point in the history
  • Loading branch information
nICEnnnnnnnLee committed May 20, 2024
1 parent 19912a4 commit 19ffe20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nicelee/bilibili/downloaders/impl/DanmuDownloader.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package nicelee.bilibili.downloaders.impl;

import java.io.File;
import java.io.FileWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.util.List;

Expand All @@ -11,7 +12,6 @@
import nicelee.bilibili.enums.StatusEnum;
import nicelee.bilibili.util.HttpHeaders;
import nicelee.bilibili.util.HttpRequestUtil;
import nicelee.bilibili.util.Logger;
import nicelee.bilibili.util.ResourcesUtil;
import nicelee.bilibili.util.danmuku.Danmuku;
import nicelee.bilibili.util.danmuku.Xml2Ass;
Expand Down Expand Up @@ -56,9 +56,9 @@ public boolean download(String url, String avId, int qn, int page) {
status = StatusEnum.FAIL;
return false;
}
FileWriter out = null;
OutputStreamWriter out = null;
try {
out = new FileWriter(xmlfile, Charset.forName("UTF-8"));
out = new OutputStreamWriter(new FileOutputStream(xmlfile),Charset.forName("UTF-8"));
out.write(result);
status = StatusEnum.SUCCESS;
//Logger.println(result);
Expand Down

0 comments on commit 19ffe20

Please sign in to comment.