Hi!
My method recieves the formal parameter Buffer. I can't figure out how to read and write it partially.
Example
procedure my_proc( var Buffer; count: int64 ) //let count be 100
var
strm1, strm2: tStream;
begin
...
//read\write 20 bytes from strm1
//read\write 80 bytes from strm2
I do it via temporary stream but it is not a nice way I think, and it must decrease the performance.
Somewhere on this forum people say that such untyped variable is a pointer itself. But pointer logic like
strm2.Read( buffer+20, 80 )
gives a compilation-time error.
Am I to cast Buffer to pointer explicitly? Or maybe I have to cast Buffer to something iterable like
type tByteArray = array of byte;
...
strm2.Read( tByteArray( Buffer )[20], 80 )
? Or maybe there's another solution?
Thx