code: function extend(inarr, newlen) {
    //--byte newarr[];
    var newarr;
    if (inarr.length==newlen)
     return inarr;
    newarr=createArrayWithZeros(newlen);
    //--java.lang.System.arraycopy((java.lang.Object)inarr,0,(java.lang.Object)newarr,0,inarr.length);
    this.arraycopy(inarr,0,newarr,0,inarr.length);
    // 0 padding is carried out by the JVM on allocation initialization
    return newarr;
    }
docs: /* <sgml> Extend byte array to given length, padding with 0s.  If no
  extension is required then return the same array. </sgml>
  
  Arg1 is the source byte array
  Arg2 is the new length (longer)
   --private static final byte[] extend(byte inarr[],int newlen){