Hello. Tell me how to do? The problem is this. It is necessary to consider the file as specified blocks. I use for this FileStream.Read and it reads the file in blocks, and gradually loading it into memory. But I wanted that he would read with each new unit, do something with him and forget it, not keeping what he had read before. Tell me how can this be done? As well as to make it so that the reading starts from the specified position, for example, from 3/4 or 1/2 file.
|
1 answer
Behold the power of documentation
public override long Seek( long offset, SeekOrigin origin) You can specify the offset in bytes from the beginning of the file.
Call it like this:
fs.Seek(100500, SeekOrigin.Begin); //указать потоку, // что дальше будем читать //байты, отступив 100500 //байт от начала файла fs.Read... //читать |