Article View: borland.public.jbuilder.java.language
Article #14498Re: convert bytes to characters
From: Kobus du Toit
Date: Fri, 27 Aug 1999 00:00
Date: Fri, 27 Aug 1999 00:00
36 lines
1222 bytes
1222 bytes
This might help
public class WByte extends Object
{
public static String byteTostr(byte[] buf, int intSize)
{
char chrCurrent;
String strValue = "";
for (int i = 0; i < intSize; i++)
{
chrCurrent = (char) buf[i];
if (chrCurrent == '|')
return strValue;
strValue = strValue + Convert.toString(chrCurrent);
}
return strValue;
}
public WByte()
{
}
}
Kobus
Marcel van den Dungen wrote:
> Hi,
>
> Where can I find methods for converting a byte array to characters?
> (each byte represents a character)
>
> Thanks in advance!
>
> Bas
Technical Details
Message-ID:
<37C66E96.BD31FAB@iname.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37C25239.55B22DE2@c-content.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,592ac35a1a52fece X-Google-Attributes: gidf74b3,public From: Kobus du Toit <battlezone@iname.com> Subject: Re: convert bytes to characters Date: 1999/08/27 Message-ID: <37C66E96.BD31FAB@iname.com> X-Deja-AN: 517747990 Content-Transfer-Encoding: 7bit References: <37C25239.55B22DE2@c-content.nl> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: battlezone@iname.com Newsgroups: borland.public.jbuilder.java.language