Indexing char files with non-fixed character length

H

Harald Kirsch

Consider a file containing variable length records separated
by a freely chosen unicode character. The encoding of the file is not
necessarily one where one character is represented by a fixed number
of bytes. In particular the encoding cannot be hard-coded in the software.

Is there an easy way to get hold of the seek-positions of the records
in order to create an index pointing to the records?

What makes this particularly difficult is the combination of non-fixed
character code length and buffering in a CharsetDecoder.

The solution I can think of involves very clumsy stuff with driving a
CharsetDecoder one character at a time. Am I missing something?
Should this not be a few calls to available library methods?

Any ideas,
Harald.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top