qq_29436537
bxsuna
2015-12-22 09:29

Syntax error on token ")", ; expected 这种错误要怎样解决?

  • error

以下室出现错误的代码,出现在连个try后面的括号中。
public static String ConvertStreamToString(InputStream is, String charset)
throws Exception {
StringBuilder sb = new StringBuilder();
try(InputStreamReader inputStreamReader = new InputStreamReader(is,
charset)){
try(BufferedReader reader = new BufferedReader(inputStreamReader)){
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line).append("\r\n");
}
}
}
finally{
return sb.toString();
}
}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐

换一换