[ipv6][Feat]讯飞语音合成升级成离线版

This commit is contained in:
chenfufeng
2025-04-23 19:43:08 +08:00
committed by yangyakun
parent dd0cd108dc
commit 0ff13a6a41
22 changed files with 939 additions and 4 deletions

View File

@@ -24,6 +24,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -1818,6 +1820,26 @@ public final class FileUtils {
}).start();
}
public static void writeFile(String path, byte[] bytes) {
boolean append = false;
try {
File file = new File(path);
if (file.exists()) {
append = true;
}else {
file.createNewFile();
}
FileOutputStream out = new FileOutputStream(path,true);//指定写到哪个路径中
FileChannel fileChannel = out.getChannel();
fileChannel.write(ByteBuffer.wrap(bytes)); //将字节流写入文件中
fileChannel.force(true);//强制刷新
fileChannel.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 文件拷贝监听