final public int read(final byte[] a,final int aoff,final int alen) throws IOException {
  if (alen == 0) {
    return 0;
  }
  final int remaining=limit - off;
  if (remaining == 0) {
    return -1;
  }
  final int n=remaining < alen ? remaining : alen;
  System.arraycopy(buf,this.off,a,aoff,n);
  this.off+=n;
  return n;
}

final public int read ( final byte [ ] a , final int aoff , final int alen ) throws IOException { if ( alen == 0 ) { return 0 ; } final int remaining = limit - off ; if ( remaining == 0 ) { return - 1 ; } final int n = remaining < alen ? remaining : alen ; System . arraycopy ( buf , this . off , a , aoff , n ) ; this . off += n ; return n ; }
overridden for more efficiency .
