作者HYL (@Bay Area)
站内java
标题Re: [问题] 有关FileInuptStream...
时间Sat Apr 29 16:26:31 2006
※ 引述《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