我使用 InputStreamReader 传输压缩图像。InflaterInputStream 用于图像的解压
InputStreamReader infis =
new InputStreamReader(
new InflaterInputStream( download.getInputStream()), "UTF8" );
do {
buffer.append(" ");
buffer.append(infis.read());
} while((byte)buffer.charAt(buffer.length()-1) != -1);
但是所有非拉丁字符都变成“?” 并且图像已损坏http://s019.radikal.ru/i602/1205/7c/9df90800fba5.gif
随着未压缩图像的传输,我使用 BufferedReader 并且一切正常
BufferedReader is =
new BufferedReader(
new InputStreamReader( download.getInputStream()));