
Java/파일 입출력
[Java / 파일 입출력] 객체
객체 출력객체 형식의 데이터를 파일 출력하는 방식직렬화(`Serialize`) + 분해 + 임시저장 + 출력을 단계별로 진행`java.io.Serializable`을 상속받은 클래스만 출력 가능`IoException` 예외 전가 필수File dir = new File("sample");dir.mkdirs();File target = new File("sample", "object.kh");FileOutputStream out = new FileOutputStream(target);BufferedOutputStream buffer = new BufferedOutputStream(out);ObjectOutputStream obj = new ObjectOutputStream(buffer);Date d = ne..