Thanks all, for your responses.
I was thinking that a pointer to the variable in the buffer array would be the way to go.
However, the file format ('.shp') mixes both endian formats, so it's safer to control this by shl as suggested by engkin.
My readDouble() function seems to work ok for 8-byte doubles and I've written this for other number formats:
function readInteger(buff: array of byte; pos,size: integer): integer;
var
i,val,sh, endpos, interv: integer;
begin
sh:=0;
Result:=0;
interv:=1;
endpos:=pos+size;
i:=pos;
if size<0 then
begin
interv:=-1;
endpos:=pos;
i:=pos-size-1;
end;
while i<>endpos do
begin
val:=buff[i];
Result+=val shl sh;
Inc(sh,8);
i+=interv;
end;
end;
A four byte big-endian integer occurring in the buffer at byte 4 would be read like this: myInt:=readInteger(buffer,4,4);
and a four byte little-endian integer occurring in the buffer at byte 4 would be read like this: myInt:=readInteger(buffer,8,-4);