java.io.StreamCorruptedException: invalid type code: 결과적으로 아래의 코드에서 발생하는 에러 중 invalid type code: 는 스트림을 새로 생성하는 방법으로 해결할 수 있었고