I'm reading an unknown number of objects from a gzipped file in Kryo:
Input input = new Input(new GZIPInputStream(Files.newInputStream(inputFile)));
The problem is: How do I detect when I've read the last object from the file? When I'm writing the objects I don't know in advance how many I will be writing, so I can't include a count of the objects at the start of the file.
I could have some kind of "dummy" object that I write at the end of the file to indicate that it's the last one, but that seems ugly.