title: Fast read/write from file in delphi
body: <p>I am loading a file into a array in binary form this seems to take a while
  is there a better faster more efficent way to do this.
  i am using a similar method for writing back to the file.</p>
  
  <pre><code>procedure openfile(fname:string);
  var
      myfile: file;
      filesizevalue,i:integer;
  begin
    assignfile(myfile,fname);
    filesizevalue:=GetFileSize(fname); //my method
    SetLength(dataarray, filesizevalue);
    i:=0;
    Reset(myFile, 1);
    while not Eof(myFile) do
      begin
        BlockRead(myfile,dataarray[i], 1);
        i:=i+1;
      end;
    CloseFile(myfile);
  end;
  </code></pre>