@BREAD[handle,offset,filehandle,fileoffset,length] : Read from a file to a binary buffer.


handle - a binary handle from @BALLOC


offset - the byte offset in the buffer (decimal or hex)


filehandle - a file handle opened for reading (from @FILEOPEN)


fileoffset - the read offset (from the current file position) (decimal or hex)


length - number of bytes to read (decimal or hex)


@BREAD returns the number of bytes actually read.




set fhandle=%@fileopen[filename,r]

set bhandle=%@balloc[128]

set value=%@bread[%bhandle,0,%fhandle,0,32]