RFR of 8180451: ByteArrayInputStream should override readAllBytes, readNBytes, and transferTo

Paul Sandoz paul.sandoz at oracle.com
Tue Dec 12 19:42:41 UTC 2017



> On 11 Dec 2017, at 12:47, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
> 
> https://bugs.openjdk.java.net/browse/JDK-8180451
> http://cr.openjdk.java.net/~bpb/8180451/webrev.00
> 
> 1. Add overrides of readAllBytes(), readNBytes(), and transferTo().
> 2. Simplify parameter checks in read(byte[],int,int).
> 3. Change <code>foo</code> to {@code foo}.
> 

Minor thing (no need for another review round):

 208     public synchronized long transferTo(OutputStream out) throws IOException {
 209         int pos0 = pos;
 210         out.write(buf, pos, count - pos);
 211         pos = count;
 212         return count - pos0;
 213     }


  int len = count - pos
  out.write(but, pos, len);
  pos = count;
  return len;


Paul.

> Thanks,
> 
> Brian



More information about the core-libs-dev mailing list