Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert IEEE754 to binary integer

807603Feb 15 2008 — edited Feb 20 2008
Hi everybody,

First of all I'm sorry, because I think I've added this post before in a wrong forum.
My problem is that I'm trying to compress a set of data in IEEE754 format and little endian. The first thing I want to do is convert this data in binary integers an then crop the resolutions of those integer numbers.
I've tried the next code:

in = new DataInputStream(new FileInputStream(file));
out = new DataOutputStream(new FileOutputStream("toInteger.bin"));
+while (true) { // exception deals catches EOF+
out.writeInt((int)in.readDouble());
+}+

but the results are not what I want.
Does anybody know how can I do it?

Thank you in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 19 2008
Added on Feb 15 2008
9 comments
243 views