writing to random access file with specific encoding
i am trying to write in a random access file some records
the name of the file is typed by the user in a specific field
file = new RandomAccessFile((name.getText() + ".txt"), "rw");
after i finish with the records of the file
i close the file
then i reopen the same file in order to manipulate some data
and i observed that the reason i cannot manipulate the data
is because the file is stored with the Unicode(big endian) encoding
and not with the ANSI ecoding
i would be very greatful
What type of data are you storing in the file? Characters in Java should be written and read the same way so if you are generating the file and reading it in Java then you shouldn't have a problem. If you are talking about a binary file, then I would recommend using a class for that such as DataInputStream. Whichever way you go, just make sure that the reading and writing classes are making the same assumptions about the file.
I'm not sure if I answered you question, but I hope this helps.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL