Devi utilizzare ObjectInputStream ed ObjectOutputStream.