Question Locked

Reading Java Bytecode in C#

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

For my work I need to read up a bin file made in Java (thus in Java bytecode). I luckily know what I have to read and read up de bytes 4 by 4. The trick seems to work. The header info corresponds with what the original reader finds. Thereafter comes a pile of floats. Unfortunately I have a feeling that I am reading the floats wrong. So my question is, is a Java float the same as C#, when expressed in bytes?

Cheers - Gj

3 replies

by jslarochelle

Both must be represented according to the IEEE 754 standard. Translating this to a custom format would just complicate things. The byte ordering might be a problem though. I should be possible for you to perform tests with a known values and deduce the byte ordering and perform the required permutation.

by gjsonke

You're right about the 754 thing, wouldn't make sense. I think I'd beter test it like you say, see if there's a difference.

thnx - Gj

This discussion is closed to new replies.