データ取るだけならformatsのループ回してから
buf: array of byte;
setlength(buf, getdatasize(myhandle));
move(myhandle, buf, length(buf));