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 Urgent General Help 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 "Urgent General Help" Watch "Urgent General Help" New topic
Author

Urgent General Help

Sameer Shaikh
Greenhorn

Joined: Aug 17, 2001
Posts: 1
Can any one tell me i want to write a string using the FileOutputStream the write method takes a byte[] as parameter can any one tell me whether any other possible way to write the string in the file , or any method which converts String to Byte[] .
------------------
syed fazal faheem
Greenhorn

Joined: Jul 13, 2001
Posts: 12
Hi,
You can convert string into an array of bytes using the following methods in String class:
1. public byte getBytes()[];
2. public void getBytes(int, int, byte[], int);
3. public byte getBytes(java.lang.String)[] throws java.io.UnsupportedEncodingException;

check it out for urself:
just type "javap java.lang.String |more" at the command prompt
bye
fazal.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent General Help