I\'ve been trying to figure out why a method I\'ve written to read objects from a file didn\'t work and realized that the available() method of ObjectInputStream gave 0 even
Although this is not documented clearly I have realized from experience that it has to do with dynamic data. If your class only contains statically typed data, then available()
is able to estimate the size. If there are dynamic data in your object, like lists etc, then it is not possible to make that estimation.