I
ickz
I am trying to send various data via an ObjectOutputStream. Its working
fine for any ints or Strings, but when I try to write a customised
object, it appears to be not written at all - as when reading things
back in at the other side (via ObjectInputStream), an EOFException
occurs (where that customised object should be).
I've been trying to write the object using
'writeObject(myCustomisedObject);' - no errors are thrown for the
writing, it just doesn't appear to actually write it. The customised
class is serialisable and I tried adding in :
public void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
}
public void readObject(ObjectInputStream s) throws IOException,
ClassNotFoundException {
s.defaultReadObject();
}
and tried to use those methods, but this didn't get me anywhere either.
Any hints as to what I'm doing wrong and what I need to look at? Any
help would be much appreciated, thanks.
fine for any ints or Strings, but when I try to write a customised
object, it appears to be not written at all - as when reading things
back in at the other side (via ObjectInputStream), an EOFException
occurs (where that customised object should be).
I've been trying to write the object using
'writeObject(myCustomisedObject);' - no errors are thrown for the
writing, it just doesn't appear to actually write it. The customised
class is serialisable and I tried adding in :
public void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
}
public void readObject(ObjectInputStream s) throws IOException,
ClassNotFoundException {
s.defaultReadObject();
}
and tried to use those methods, but this didn't get me anywhere either.
Any hints as to what I'm doing wrong and what I need to look at? Any
help would be much appreciated, thanks.