Agree that this should be fixed. However, from the end-user perspective this should never be an issue because at some point in future Ignite might need to append some extra bytes to the Externalizable object layout, thus reading beyond that limit will break the unmarshalling process.
If, by the time we invoke readExternal, we know the size of the written externalizable object then we can create a thin wrapper around the existing input stream which will provide the desired behavior. However, this will come at a cost of generating more garbage, so I would just fix the return value for the input stream.
