public int alloc(int size){
  int index=n;
  int len=array.length;
  if (n + size >= len) {
    byte[] aux=new byte[len + blockSize];
    System.arraycopy(array,0,aux,0,len);
    array=aux;
  }
  n+=size;
  return index;
}

public int alloc ( int size ) { int index = n ; int len = array . length ; if ( n + size >= len ) { byte [ ] aux = new byte [ len + blockSize ] ; System . arraycopy ( array , 0 , aux , 0 , len ) ; array = aux ; } n += size ; return index ; }
this is to implement memory allocation in the array . like malloc ( ) .
