while ((nReaded = is.read(buffer)) > 0 && nLeftLength > 0) {}
這個(gè)邏輯不對(duì),如果nLeftLength = 0,那就是已經(jīng)讀完了,但是還是執(zhí)行 read,那就阻塞了。
應(yīng)該改成這樣
while (nLeftLength > 0 && (nReaded = is.read(buffer)) > 0) {}
這個(gè)邏輯不對(duì),如果nLeftLength = 0,那就是已經(jīng)讀完了,但是還是執(zhí)行 read,那就阻塞了。
應(yīng)該改成這樣
while (nLeftLength > 0 && (nReaded = is.read(buffer)) > 0) {}
2016-07-24