private void ensureCapacity(int length){
  int newcount=count + length;
  if (newcount > buf.length) {
    byte newbuf[]=new byte[Math.max(buf.length + 100,newcount)];
    System.arraycopy(buf,0,newbuf,0,count);
    buf=newbuf;
  }
}

private void ensureCapacity ( int length ) { int newcount = count + length ; if ( newcount > buf . length ) { byte newbuf [ ] = new byte [ Math . max ( buf . length + 100 , newcount ) ] ; System . arraycopy ( buf , 0 , newbuf , 0 , count ) ; buf = newbuf ; } }
ensure the stream is able to store next n bytes . grow the array if necessary .
