2024-09-21 16:50:53 +08:00
|
|
|
//import java.io.FileInputStream;
|
2023-11-02 22:02:39 +08:00
|
|
|
import java.io.FileOutputStream;
|
2024-09-21 16:50:53 +08:00
|
|
|
//import java.io.InputStreamReader;
|
2023-11-02 22:02:39 +08:00
|
|
|
import java.io.OutputStreamWriter;
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
|
|
|
public class CommonHelper {
|
|
|
|
|
2024-09-21 16:50:53 +08:00
|
|
|
// public static InputStreamReader openReader(String filename) throws Exception {
|
|
|
|
// FileInputStream fs = new FileInputStream(filename);
|
|
|
|
// return new InputStreamReader(fs, StandardCharsets.UTF_8);
|
|
|
|
// }
|
2023-11-02 22:02:39 +08:00
|
|
|
|
|
|
|
public static OutputStreamWriter openWriter(String filename) throws Exception {
|
|
|
|
FileOutputStream fs = new FileOutputStream(filename);
|
|
|
|
return new OutputStreamWriter(fs, StandardCharsets.UTF_8);
|
|
|
|
}
|
|
|
|
|
2024-09-21 16:50:53 +08:00
|
|
|
// public static void writeSnippet(OutputStreamWriter writer, String snippet_path) throws Exception {
|
|
|
|
// // open snippet
|
|
|
|
// InputStreamReader reader = openReader(snippet_path);
|
|
|
|
// // write into writer
|
|
|
|
// reader.transferTo(writer);
|
|
|
|
// reader.close();
|
|
|
|
// }
|
2023-11-02 22:02:39 +08:00
|
|
|
|
|
|
|
public static String getDoxygenInOutStr(boolean isInput) {
|
|
|
|
return isInput ? "in" : "out";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|