public synchronized void resizeMatrix(int newsize) throws IOException {
  if (newsize >= 0xFFFF) {
    throw new RuntimeException("Matrix size is too big and will overflow the integer datatype.");
  }
  if (!array.isWritable()) {
    throw new IOException("Can't resize a read-only array.");
  }
  array.resizeFile(arraysize(newsize));
  this.matrixsize=newsize;
  ByteBuffer header=array.getExtraHeader();
  header.putInt(this.matrixsize);
}

public synchronized void resizeMatrix ( int newsize ) throws IOException { if ( newsize >= 0xFFFF ) { throw new RuntimeException ( "Matrix size is too big and will overflow the integer datatype." ) ; } if ( ! array . isWritable ( ) ) { throw new IOException ( "Can't resize a read-only array." ) ; } array . resizeFile ( arraysize ( newsize ) ) ; this . matrixsize = newsize ; ByteBuffer header = array . getExtraHeader ( ) ; header . putInt ( this . matrixsize ) ; }
resize the matrix to cover newsize x newsize .
