Details
-
Bug
-
Resolution: Fixed
-
P4
-
21, 22
-
b03
Description
Currently the code in SequenceInputStream.transferTo() contains
if (transferred < Long.MAX_VALUE) {
try {
transferred = Math.addExact(transferred, in.transferTo(out));
} catch (ArithmeticException ignore) {
return Long.MAX_VALUE;
}
}
whereas it should contain the equivalent of what is in InputStream.transferTo
if (transferred < Long.MAX_VALUE) {
try {
transferred = Math.addExact(transferred, read);
} catch (ArithmeticException ignore) {
transferred = Long.MAX_VALUE;
}
}
if (transferred < Long.MAX_VALUE) {
try {
transferred = Math.addExact(transferred, in.transferTo(out));
} catch (ArithmeticException ignore) {
return Long.MAX_VALUE;
}
}
whereas it should contain the equivalent of what is in InputStream.transferTo
if (transferred < Long.MAX_VALUE) {
try {
transferred = Math.addExact(transferred, read);
} catch (ArithmeticException ignore) {
transferred = Long.MAX_VALUE;
}
}
Attachments
Issue Links
- relates to
-
JDK-8297632 InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE
- Resolved