On Jan 22, 2018, at 7:05 AM, Weijun Wang <weijun.w...@oracle.com> wrote:
>> Both methods that throw and not throw have been proposed. But adding two >> methods >> seems like to too much clutter in the API and the methods appear too similar. > > Sorry I wasn't aware of earlier discussions on this. My feeling is that > readNBytesFully() is more useful than readNBytesAtMost(). There was also a proposal to add a single method byte[] readNBytes(int len, boolean exact) which would read at most ‘len’ bytes but would throw an IOE if the length of the returned array were less than ‘len’ and ‘exact’ were true. This was rejected as being too confusing. Brian