|
||
|
|||
|
FileInputSream, BufferedInputStream
FileReader, BufferedReader These classes AFAIK only have read methods which return strings, char arrays or byte arrays, or single bytes. The problem is if I want to read 2 byte floats or 4 byte double precision IEEE floating point numbers, how do I read them and use them in java?? I really don't to read these byte by byte and have to do manual binary number manipulation and reading. Thanks for reading! Thanks for helpful comments in advance!
|
|
|||
|
I tried this but it only seems to read the number as the ascii representation not the actual value, ie. it reads 0x3132 as 12 from the ascii character for 0x31 for 2 and the ascii character for 0x32 is 2, but what I need is the actual number (IEEE integer) as in 0x3132 is 12849.
|
|
|||
|
Nvm I found the answer, DataInputStream lets you read all data types including unsigned values. Except I still don't know how to handle big-endian little-endianess.
Last edited by username9000; 30-06-2009 at 07:12 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Using 3rd Party JAR Files | oss_2008 | Java Theory & Questions | 12 | 12-06-2009 03:27 PM |
| How to Populate all array values using the java.util.Arrays class | JavaPF | Java Code Snippets and Tutorials | 0 | 07-04-2009 10:31 AM |
| How to check an input is an integer as oppose to a float | Konnor | File I/O & Other I/O Streams | 3 | 02-02-2009 09:37 AM |
| code help 2 programs. MinMax Values & Converting Temps. | awake77 | What's Wrong With My Code? | 6 | 20-12-2008 09:12 PM |
| Float to binary | rosh72851 | Java Theory & Questions | 1 | 08-10-2008 03:45 AM |