This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes how to write the String Array into the new file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to write the String Array into the new file" Watch "how to write the String Array into the new file" New topic
Author

how to write the String Array into the new file

niras iva
Greenhorn

Joined: May 10, 2011
Posts: 18
Hello Sir:
i create a own file My coding is here,

i want to write the value of s in my file.

i want to take the value of s and write into my new file..how can i do this?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

If you want to write it as text, then don't use DataOutputStream. Streams (InputStream and OutputStream) are for reading and writing binary data, not text. If you want to write text, use a Writer instead of an OutputStream. For example:


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
niras iva
Greenhorn

Joined: May 10, 2011
Posts: 18
Thank you sir
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to write the String Array into the new file
 
Similar Threads
Creating Excel File - POI
Problem in writing any double in a file
write problem in text file
DataOutputstream writeshort doesnt work
problem with writing file , please help