void ensure(int n){
  int curlen=instruction.length;
  if (lenInstruction + n >= curlen) {
    while (lenInstruction + n >= curlen) {
      curlen*=2;
    }
    char[] newInstruction=new char[curlen];
    System.arraycopy(instruction,0,newInstruction,0,lenInstruction);
    instruction=newInstruction;
  }
}

void ensure ( int n ) { int curlen = instruction . length ; if ( lenInstruction + n >= curlen ) { while ( lenInstruction + n >= curlen ) { curlen *= 2 ; } char [ ] newInstruction = new char [ curlen ] ; System . arraycopy ( instruction , 0 , newInstruction , 0 , lenInstruction ) ; instruction = newInstruction ; } }
ensures that n more characters can fit in the program buffer . if n more can ' t fit , then the size is doubled until it can .
