私の現在のコードはWebから外国文字を読み取る必要があります。現在、私のソリューションは機能しますが、InputStreamReaderを使用してcharごとに読み取るため、非常に低速です。それをスピードアップし、仕事を終わらせる方法はありますか?
// Pull content stream from response
HttpEntity entity = response.getEntity();
InputStream inputStream = entity.getContent();
StringBuilder contents = new StringBuilder();
int ch;
InputStreamReader isr = new InputStreamReader(inputStream, "gb2312");
// FileInputStream file = new InputStream(is);
while( (ch = isr.read()) != -1)
contents.append((char)ch);
String encode = isr.getEncoding();
return contents.toString();