tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: [OT] Basic int/char conversion question
Date Thu, 01 Jan 2009 16:42:37 GMT
> From: André Warnier [mailto:aw@ice-sa.com]
> Subject: [OT] Basic int/char conversion question

> I cannot change the InputStream into something else

Actually, I think you can.  If you wrapper the InputStream with an InputStreamReader specifying
the desired character set, the rest of the code can continue to use the read() method and
check for specific character (rather than byte) values.  For example:

fromApp = new InputStreamReader(socket.getInputStream(), Charset.forName("ISO-8859-2"));

As long as the code is checking for values in the ASCII range (0 - 127) or -1, I believe this
will work for you.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message