Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

Re: Loading null-terminated strings from file

 
 
Roedy Green
Guest
Posts: n/a
 
      07-09-2003
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
encoding.

See http://mindprod.com/fileio.html for sample code to read the bytes
and http://mindprod.com/converter.html for how to convert the byte
array to a String.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
Reply

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



Advertisments