View Single Post
  #10 (permalink)  
Old 05-20-2008, 11:33 AM
glen herrmannsfeldt
Guest
 
Posts: n/a
Default Re: encoding="utf-8" and formatted direct access

James Giles wrote:

> James Giles wrote:


>>And I'm guessing here that Java has no direct I/O support? That
>>is, random access to records of utf9 data is probably not supported.


> I mean utf8, of course. ...


You do something similar to C's fseek().

That is, you define your own record length and seek in
multiples of that length. It is, then, up to the programmer
to select the appropriate length such that the needed
UTF8 data fits in a record.

http://java.sun.com/javase/6/docs/ap...ccessFile.html

The modified version of UTF-8 is described in:

http://java.sun.com/javase/6/docs/ap...modified-utf-8

It would be nice to have a method to indicate the length of
a String converted to modified UTF-8 form, but I don't see it.

-- glen

Reply With Quote