, String BlackBerry (ISO-8859-1). , UTF-8. , smth :
public static String getStringFromStream(InputStream in, String encoding) throws IOException {
InputStreamReader reader;
if (encoding == null) {
reader = new InputStreamReader(in);
} else {
reader = new InputStreamReader(in, encoding);
}
StringBuffer sb = new StringBuffer();
final char[] buf = new char[1024];
int len;
while ((len = reader.read(buf)) > 0) {
sb.append(buf, 0, len);
}
return sb.toString();
}