Results 1 to 2 of 2
  1. #1
    vata2999 is offline Member
    Join Date
    Jul 2007
    Posts
    8
    Rep Power
    0

    Post Write unicode into file

    Hi Everybody,
    I want to write into file in persian
    Which class is better to use RandomAccessFile , FileWriter or FileOutputStream
    or DataOutPut or What ....?
    I write my code in two manner
    1) for(int i=0;i<myStr.Length();i++) fos.writeUTF(myStr.charAt(i));
    2)fos.write(myStr);
    But does not work
    What should i do ?

  2. #2
    henry_78 is offline Member
    Join Date
    Aug 2007
    Posts
    47
    Rep Power
    0

    Default

    Hi,
    U can write in a file in bytes..that would solve the format problem.
    Use the method writeTo() of the class ByteArrayOutputStream.
    Writing in the file is easy..u will have to find a way to read in the right way from the file.

Similar Threads

  1. how to write onto a file
    By mirage_87 in forum New To Java
    Replies: 6
    Last Post: 09-08-2009, 04:54 PM
  2. writing and reading unicode characters from a file
    By ranoosh in forum Advanced Java
    Replies: 4
    Last Post: 09-28-2008, 05:34 AM
  3. how do i write to a text file from an arraylist?
    By otoro_java in forum New To Java
    Replies: 3
    Last Post: 01-30-2008, 07:53 AM
  4. File Write Error
    By vikain in forum Advanced Java
    Replies: 5
    Last Post: 01-02-2008, 05:38 AM
  5. Help with write file in java
    By mathias in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 07:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •