Hello,
i have a problem by get content from a file (HTML Code). The code looks like this:
BufferedInputStream is = new BufferedInputStream ( new FileInputStream (name) );
Later the InputStream
is will read and stored in a ByteArrayOutputStream
bytearrayoutputstream. Code for this looks like this:
byte abyte0[] = new byte;
int j = inputstream.read(abyte0);
bytearrayoutputstream.write(abyte0, 0, j);
When i debug (with tomcat and eclipse) my application (portal) and look in the variable [i]is i see only the values 0.
When i look in the bytearrayoutputstream after the variable is is stored in i can see the content of the file (the HTML code which is readed). The HTML code comprised some cyrillic characters. This cyrillic characters are not correct displayed in the variable bytearrayoutputstream. The cause of this is, in my opinion, that i can not specify the encoding which should be UTF-8.
WHAT can i do that i get an byteArrayOutputStream with the correct display cyrillic characters (with the right encoding UTF-8) ??
Thank you for your help.
Greets Oliver