java.io.StreamCorruptedException: Type code out of range, is -84
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, May 23, 2002 04:50 PM

I am trying to write an object over a socket using objectoutputstream But i am getting this error : java.io.StreamCorruptedException: Type code out of range, is -84 My code is as follows : Client side System.out.println("I am sending the items vector in drawcode, its hashcode is : " + message.hashCode()); oos.writeObject(message); Listener side Vector element = new Vector(); element = (Vector)ois.readObject(); System.out.println("I have just received the vector in drawListener, its hashcode is : " + element.hashCode());    More>>

I am trying to write an object over a socket using objectoutputstream

But i am getting this error :

java.io.StreamCorruptedException: Type code out of range, is -84



My code is as follows :



Client side


			
System.out.println("I am sending the items vector in drawcode, its

hashcode is : " + message.hashCode());

oos.writeObject(message);




Listener side


			
Vector element = new Vector();

element = (Vector)ois.readObject();

System.out.println("I have just received the vector in drawListener, its

hashcode is : " + element.hashCode());




I am gettting a :



java.io.StreamCorruptedException: Type code out of range, is -84


at

java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1556)


at java.io.ObjectInputStream.refill(ObjectInputStream.java:1684)

at

java.io.ObjectInputStream.readObject(ObjectInputStream.java:283)


at

java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)


at final_year.drawListener.run(drawListener.java:245)




drawListener line 245 is :

element = (Vector)ois.readObject();



Does anyone know whats going wrong ?

Or even what the error means ??



Any help is much appreciated ,

Thanks,

M

   <<Less
About | Sitemap | Contact