[item 88, 89, 90] 직렬화
📚 writeObject, readObject란?
기본적인 자바 직렬화 또는 역직렬화 과정에서 별도의 처리가 필요할 때는 writeObject
와 readObject
메서드를 클래스 내부에 선언해주면 된다. 물론 해당 클래스는 Serializable
인터페이스를 구현한 직렬화 대상 클래스여야 한다. 직렬화 과정에서는 writeObject
가 역직렬화 과정에서는 readObject
메서드가 자동으로 호출된다.