How do I save and multiple objects from a single file?
问题 I'm trying to create a system where a user can choose a set of ID's(Federation IDs) to retrieve data from an external API. After the data is retrieved from the web service I wish to store it locally for later use. Now, my problem is that I know how to load an object from an ObjectInputStream by taking the entire file(federations.dat). Is there a way for me to load say "object WHERE id = N" from "federations.dat" ? Or do I have to create separate files for each object? This is my load method: