看板 java 關於我們 聯絡資訊
※ 引述《forkome (烏龜)》之銘言: : ※ 引述《PsMonkey (痞子軍團團長)》之銘言: : : ==站內信件== : : read the API document first : 小弟不才再請教一下 : public int read(byte[] b) throws IOException : Reads up to b.length bytes of data from this input stream into an array of bytes. : This method blocks until some inpuis available. : 他的意思是不是指依照b array的長度來讀取input stream裡的內容呢? : 如果是的話,他為什麼要這麼做? 試想看看你有個 1G 的檔案,你要一次把 1G 都讀到記憶體才 來做處理,還是一個 1k ~ 1M 的區塊做處理。再來若你用的 是記憶體有限的硬體、或者是同時有多人存取的系統,你會怎 麼選擇? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 24.5.191.38