RFR 8139206: Add InputStream readNBytes(int len) (original) (raw)
Brian Burkhalter brian.burkhalter at oracle.com
Mon Jan 22 15:51:50 UTC 2018
- Previous message: RFR 8139206: Add InputStream readNBytes(int len)
- Next message: RFR 8139206: Add InputStream readNBytes(int len)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jan 22, 2018, at 7:05 AM, Weijun Wang <weijun.wang at 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
- Previous message: RFR 8139206: Add InputStream readNBytes(int len)
- Next message: RFR 8139206: Add InputStream readNBytes(int len)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]