我想设置一个try catch语句,该语句可以在文件中编写html代码并更改文件类型。我该怎么做?
public void text(String filename) {
try {
FileOutputStream out= new FileOutputStream(filename+".word");
FileInputStream in= new FileInputStream(filename+".html");
byte b;
b = (byte) fin.read();
System.out.println("<html>")
out.write(b)
System.out.println("<html>")
out.close();
in.close();
} catch (IOException e) {
System.out.println(e.getMessage());
}
}