[5418] in java-interest
Re: read functions
daemon@ATHENA.MIT.EDU (Stan Guillory)
Thu Feb 8 11:30:50 1996
From: guillory@ncsa.uiuc.edu (Stan Guillory)
To: knrc@impltd.com (Kevin Conner)
Date: Thu, 8 Feb 1996 09:04:51 -0600 (CST)
Cc: java-interest@java.sun.com
In-Reply-To: <3119B65F.7461@impltd.com> from "Kevin Conner" at Feb 8, 96 08:37:51 am
> Hiya Stan
>
> I believe your problem is that you are using the classes which
> deal with the binary representation of your values (DataXXX).
>
> When you type in 4.5 it is interpreting the binary representation
> of those characters as the binary representation for your float.
> Try using the PrintStream class for your output or, alternatively,
> use the String routines within DataXXX.
The problem is not output. If I have an internal float float
variable, then DataOutputStream::writeFloat() writes is properly
to the stream. It is input. The problem is what the heck is
DataInputStream::readFloat() doing. I mean, what can readFloat()
or any of the read<type> functions be used for?
>
> The Float class has a valueOf method which can be used to parse
> a String.
Yeah, I used that in my example that was in my mail. That's how
I read the basic numeric types. But the read<type> functions look
so enticingly useful.
>
> Good luck,
> Kev
Thanks Kev.
Stan
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com