DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: Deserialization

  1. #1
    Join Date
    Sep 2003
    Posts
    1

    Question Deserialization

    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 in Java serialized by VC++. 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.
    Shekar

  2. #2
    Join Date
    Mar 2003
    Posts
    86

    Serializable

    Obviously that can’t be done.
    When you try to deserialize a java object it must have been serialized using java.

    What you can do is define a protocol between the two applications. E.g. write the file is a specific format, and expect this format when reading it.

    Sharbov.

  3. #3
    Join Date
    Mar 2003
    Posts
    834
    Or be nice and snazzy and use XML as an exchange format.... :-D
    ArchAngel.
    O:-)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links