Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: Loading null-terminated strings from file

Thread Tools

Re: Loading null-terminated strings from file

Roedy Green
Posts: n/a
On Wed, 09 Jul 2003 15:36:14 GMT, "<insert my name here>"
<(E-Mail Removed)> wrote or quoted :

>What's the easiest way to load a series of strings from a file where
>each string is simply a null-terminated string of bytes (non-unicode)
>and there are no special (ie: CR/LF) characters involved?

read them as raw bytes one at a time from a BufferedInputStream in a
loop. Then convert byte arrays you create to strings with an

See for sample code to read the bytes
and for how to convert the byte
array to a String.

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See for The Java Glossary.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strings, Strings and Damned Strings Ben C Programming 14 06-24-2006 05:09 AM
How to generate k+1 length strings from a list of k length strings? Girish Sahani Python 17 06-09-2006 11:01 AM
Catching std::strings and c-style strings at once Kurt Krueckeberg C++ 2 11-17-2004 03:53 AM
convert list of strings to set of regexes; convert list of strings to trie Klaus Neuner Python 7 07-26-2004 07:25 AM
Comparing strings from within strings Rick C Programming 3 10-21-2003 09:10 AM