C++ Reading binary data written by other Language programs

S

Sandeep

How do I read file written in Java using C++. Is there a way of doing
this in standard C++ or do I need to depend on technologies like soap
for this kind of interop.


-- Sandeep
 
V

Victor Bazarov

Sandeep said:
How do I read file written in Java using C++. Is there a way of doing
this in standard C++ or do I need to depend on technologies like soap
for this kind of interop.

If the file is written on some external storage, it's most likely
consists of _octets_ (smth like "bytes" in Java). You need to know
what each byte means in order to interpret them correctly. Reading
is easy, just use 'read' or 'get' members. Converting to your C++
internal representation is what you need to concern yourself with.

V
 
D

Dave Townsend

Sandeep said:
How do I read file written in Java using C++. Is there a way of doing
this in standard C++ or do I need to depend on technologies like soap
for this kind of interop.


-- Sandeep

There is nothing special about a file written by a Java application, you
should be able to read it with a C++ application, after all its, just a
stream
of bytes or characters.

1. Is the file text ?
2. Does it have a binary format ?

Either way, you should be able to write some code using the IOStreams
library.

dave
 
R

roberts.noah

Sandeep said:
How do I read file written in Java using C++. Is there a way of doing
this in standard C++ or do I need to depend on technologies like soap
for this kind of interop.

You need to know the file format. Language has nothing to do with it.
If the format is documented then you can do it. If not then you have
to reverse engineer the format or rely on some third party library to
provide the abstraction. At any rate you certainly /can/ do it, but
how easy it is going to be is questionable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top