I have some pretty standard code which takes in a serialized object from a stream, which bascially looks like this:
Object getObjectFromStream(InputStream is) {
There should be no difference at all -- the path you're using for getResourceAsStream() must be finding some other file. Do a search for other files stored as serializedObjects/testObject, and see if you can't find it. Remember that the FileInputStream is going to be looking relative to the current directory, while the getResourceAsStream() is relative to the class path.