//Sample01_02.java import java.io.File; import java.io.FileOutputStream; import java.io.FileNotFoundException; import java.io.IOException; class Sample01_02{ public static void main(String[] args){ String path = "hello.txt"; File file = new File(path); try { FileOutputStream outStream = new FileOutputStream(file); int intCh = 'あ'; System.out.println(String.format("あ: %x", intCh)); outStream.write(intCh); byte byteData = (byte)intCh; System.out.println(String.format("(byte)あ: %x", byteData)); System.out.println((char)byteData); outStream.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e){ e.printStackTrace(); } } }