GeeCON Prague 2014*
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


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: 14193
    
  20

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 8 API documentation
niras iva
Greenhorn

Joined: May 10, 2011
Posts: 18
Thank you sir
 
GeeCON Prague 2014
 
subject: how to write the String Array into the new file