Article View: cn.bbs.comp.lang.java
Article #23949Help needed in Serialization and UDP/IP comms
From: Paul Hussein
Date: Sun, 23 Aug 1998 00:00
Date: Sun, 23 Aug 1998 00:00
24 lines
1814 bytes
1814 bytes
I am currently trying to provide a generic class that will establish an UDP/IP Broadcast connection and broadcast datagrams. The UDP/IP stuff is fine. However, I would like to be able to take a java.lang.Object ( or an instance of a class that is inherited from it ) and convert it into bytes in an automatic manner. I've tried to use streams, creating my own UDPBroadcastInput and Output streams, but when I use the ObjectInputStream stream reader and writer the app complains about the stream being corrupt when it tries to read from it. I believe this is due to the version number being passed out from the ObjectInputStream and ObjectOutputStream . Does anyone know of any way to get round this. Alternatively is there a way of accessing serialization without using these classes so that I can manipulate the stream of bytes directly. I could always try to assign the object to an array of bytes as I would in C, however I would need to know the size of the java.lang.Object and its descendants. Is there a way of finding out ??? Any help would be very much appreciated Cheers
Technical Details
Message-ID:
<6rp73l$eel$1@plug.news.pipex.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113ae9,c8630a16e525a9b,start X-Google-Attributes: gid113ae9,public X-Google-Thread: f6cb0,c8630a16e525a9b,start X-Google-Attributes: gidf6cb0,public X-Google-Thread: 10a146,c8630a16e525a9b,start X-Google-Attributes: gid10a146,public From: "Paul Hussein" <paul.hussein@dial.pipex.com> Subject: Help needed in Serialization and UDP/IP comms Date: 1998/08/23 Message-ID: <6rp73l$eel$1@plug.news.pipex.net> X-Deja-AN: 383890112 Organization: UUNET UK server (post doesn't reflect views of UUNET UK) Newsgroups: cn.bbs.comp.lang.java,comp.lang.java.help,comp.lang.java.programmer X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3