Reading in text and casting it
From: neosenate (neosenate_at_netscape.net)
Date: 08/09/04
- Next message: Chris Uppal: "Re: abstract constructor performance?"
- Previous message: mike: "Re: Do I have to wait for my thread to finish?"
- Next in thread: Tor Iver Wilhelmsen: "Re: Reading in text and casting it"
- Reply: Tor Iver Wilhelmsen: "Re: Reading in text and casting it"
- Reply: Frank: "Re: Reading in text and casting it"
- Reply: Andrew Thompson: "Re: Reading in text and casting it"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Aug 2004 07:30:57 -0700
Hi all,
I have to write a program that will take in a txt file containing a
number of floats, parse into individual numbers and then cast the
floats into binary, before writing all the binary numbers to another
file.
At the moment i've got
StreamTokenizer in = new StreamTokenizer(new
FileReader(filename.txt));
to read in the file and to convert the floats i'm going to use,
Integer.toBinaryString(Float.floatToRawIntBits(yourFloat));
The problem i'm coming across is that i'm trying to use a tokenizer to
break up the text, but when i try and cast it, i get an error saying
that i cannot cast a non-static variable.
some of the input data in the file looks like this... "13.5 8.2
8.8 3.4".
Any help would be greatly appreciated,
Cheers
- Next message: Chris Uppal: "Re: abstract constructor performance?"
- Previous message: mike: "Re: Do I have to wait for my thread to finish?"
- Next in thread: Tor Iver Wilhelmsen: "Re: Reading in text and casting it"
- Reply: Tor Iver Wilhelmsen: "Re: Reading in text and casting it"
- Reply: Frank: "Re: Reading in text and casting it"
- Reply: Andrew Thompson: "Re: Reading in text and casting it"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|