File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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: 14268
    
  21

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to write the String Array into the new file