dcsimg
Encoding problem
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, May 16, 2006 04:46 AM

I have a file whose contents are written in french. I want to read that file and edit the file and then write the contents back to the same file. How do I do that?

I am reading file content is instanceof ByteBlock only. Then I am using
byte[] blk = ((ByteBlock) content).bytes();
FileOutputStream fs = new FileOutputStream("a.txt");
fs.write (blk, 0, blk.length);
fs.close();
During writing a file I want use encoding like ISO-8859-1. I can't use Writer because my contents are byte stream. Same way I can't use BufferedOutputStream or DataOutputStream because its not supporting encoding. How do I solve this. Please help me.

About | Sitemap | Contact