Commit 7244a16d by wutong

StringBuffer给定初始值, 避免内存溢出

parent 34a59135
......@@ -181,8 +181,7 @@ public class AmazonAdProductJob extends PointJob {
gzin = new GZIPInputStream(response.body().byteStream());
isr = new InputStreamReader(gzin, "utf8");
bufferedReader = new BufferedReader(isr);
StringBuffer sb = new StringBuffer();
StringBuffer sb = new StringBuffer((int) response.body().contentLength() * 2);
String str = null;
while ((str = bufferedReader.readLine()) != null) {
sb.append(str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment