Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / November 2005

Tip: Looking for answers? Try searching our database.

problem writing doubles with java filewriter

Thread view: 
timb11783 - 29 Nov 2005 22:29 GMT
I can write strings fine but can't write doubles. Do I have to close
the file and try writing with another method?
Roedy Green - 30 Nov 2005 00:08 GMT
>I can write strings fine but can't write doubles. Do I have to close
>the file and try writing with another method?

see http://mindprod.com/applets/fileio.html
for how to do almost any i/o.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

timb11783 - 30 Nov 2005 00:29 GMT
This does not help me
Roedy Green - 30 Nov 2005 00:52 GMT
>This does not help me

You gave almost no detail of what you were trying to do, so I could
only offer generic advice.

then see http://mindprod.com/applets/converter.html

for how to convert double <-> String
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Paulus de Boska - 30 Nov 2005 11:24 GMT
Should be a new file :
FileOutputStream fos=new FileOutputStream (pathname) ;
DataOutputStream dos=new DataOutputStream(fos);

dos.writeUTF( somestring );dos.writeDouble( somedouble );

Paul Hamaker
http://javalessons.com
Thomas Fritsch - 30 Nov 2005 16:21 GMT
> I can write strings fine but can't write doubles. Do I have to close
> the file and try writing with another method?

What do you want? Write out a double
   (1) as a human-readable String
or (2) as 8 raw bytes (IEEE-754 format) ?

Signature

"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.