public class Solution { public static void main(String[] args) throws IOException { String fileName = args[1]; String fileOutputName = args[2]; String key = args[0]; FileInputStream fis = new FileInputStream(fileName); FileOutputStream fos = new FileOutputStream(fileOutputName); byte[] c = new byte[fis.available()]; fis.read(c); if (key.equals("-e")) { String str = ""; for (byte bb : c) { str += (char) bb + "*"; } byte[] hanja = str.getBytes(); fos.write(hanja); } else { StringBuilder a = new StringBuilder(); StringBuilder cc = new StringBuilder(); for (byte l : c){ a.append((char) l); } String[] str1 = a.toString().split("\\*"); for (String g : str1){ cc.append(g); } fos.write(cc.toString().getBytes()); } fis.close(); fos.close(); } }