-
Sub-task
-
Resolution: Duplicate
-
P4
-
None
A method is needed to read up to a specific number of bytes from a stream that handles the allocation of the array similar to readAllBytes().
Reading up to nbytes can guard against excessive unexpected input while not requiring an array allocation for the full size.
The implementation of InputStream.readAllBytes() already has the functionality but does not limit the input size.
A similar function already exists in sun/security/util/IOUtils.java but is not public.
Reading up to nbytes can guard against excessive unexpected input while not requiring an array allocation for the full size.
The implementation of InputStream.readAllBytes() already has the functionality but does not limit the input size.
A similar function already exists in sun/security/util/IOUtils.java but is not public.
- csr for
-
JDK-8194957 new method InputStream.readAllBytes(int n) to read up to n bytes
-
- Closed
-
- duplicates
-
JDK-8139206 Add InputStream readNBytes(int len)
-
- Resolved
-