Deserialize a file not serialised by Java
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anand_Vasudevan
Posted On:   Tuesday, September 9, 2003 07:14 AM

Hello, I am trying to deserialize and read a file which has been previously serialized using VC++. Is there a way to read a file serialized by VC++ using Java. When i read using ObjectInputStream, exception is thrown (StreamCorruptedException). The file structure of the serialized file is as below: PC Records(Array) { ObjectRecord { Name;(string) SecurityLevel;(unsigned char) SecurityGroup;(string) ScanTime;(unsigned char) ElementNum;(int) } PCDevice;(unsigned char) m_SerNum[5];(unsigned char) m_DeviceChanCount; (unsigned char) m_ModelID; (unsigned char) m_ChanNum; (unsigned char) m_LastBlock; (unsigned short)    More>>

Hello,
I am trying to deserialize and read a file which has been previously serialized using VC++. Is there a way to read a file serialized by VC++ using Java. When i read using ObjectInputStream, exception is thrown (StreamCorruptedException). The file structure of the serialized file is as below:


PC Records(Array)
{
ObjectRecord
{
Name;(string)
SecurityLevel;(unsigned char)
SecurityGroup;(string)
ScanTime;(unsigned char)
ElementNum;(int)
}
PCDevice;(unsigned char)
m_SerNum[5];(unsigned char)
m_DeviceChanCount; (unsigned char)
m_ModelID; (unsigned char)
m_ChanNum; (unsigned char)
m_LastBlock; (unsigned short)
m_ScanTime; (unsigned char)
m_Owner; (unsigned char)
m_Gain; (unsigned char)
PCPath;(string)
m_PCName;(string)
a; (unsigned char)
b; (unsigned char)
}


could somebody help me deserialize and read this file using Java. Any help and sample source code is greatly appreciated.

   <<Less

Re: Deserialize a file not serialised by Java

Posted By:   Benoit_Quintin  
Posted On:   Tuesday, September 9, 2003 07:39 AM

You'd probably be better off wrinting a static method that reads the file and creates the object. Or creating a ClassLoader...
About | Sitemap | Contact