I recommend serialization. Object(In/Out)putStream