use ObjectInputStream and ObjectOutputStream