solve problems about EOF exception in readObject