提示
Java IO OutputStreamWriter 使用示例。@ermo
public static void write() throws IOException {
String data = "Some text wait to output to file.";
String filepath = "src/main/resources/output.txt";
OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(filepath));
try {
out.write(data);
} finally {
out.close();
}
}
public static void main(String[] args) throws IOException {
write();
}