🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19593

Newbie Question

#19593
From: David Gordon
Date: Mon, 26 Jan 1998 00:00
22 lines
1267 bytes

I am coding a program that reads a simple text file, reformats it and then
inserts it into a database.  Shown below is a code fragment from the
program:

try {
          while (ZipCodeFile.read(StateAbbrv) != -1) {
            String s = new String(StateAbbrv,0);
            ZipCodeFile.read();
            ZipCodeFile.read(ZipCodeRangeLow);
            ZipStringLow = new String(ZipCodeRangeLow,0);
            Low = Low.decode(ZipStringLow);
            ZipCodeLow = Low.intValue() * 100;
....


I have two questions.  First, the documentation says that the String
constructor I am using is "deprecated" and will not be supported in future
releases.  How can I recode this line to convert a byte array into a string?
Second, will I run into any problems allocating a new String variable every
time the loop encounters this line?
Technical Details
Message-ID: <6ajane$rk210@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,405d87fec8049c8d,start
X-Google-Attributes: gidf74b3,public
From: "David Gordon" <dgordon@microdsi.net>
Subject: Newbie Question
Date: 1998/01/26
Message-ID: <6ajane$rk210@forums.borland.com>
X-Deja-AN: 319516644
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: None
Newsgroups: borland.public.jbuilder.java.language