Q:

BinaryReader, reading by blocks, ArgumentException, Offset and length were out of bounds

My stream has 1467 bytes, One block has 489 bytes, Address is 978 and I would like one block. So it is the last block in stream [from 978 to end of file]
But I give this Exception: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
But why ? from 978 to 1467 is 489 bytes, and I try read 489 bytes from 978, so Why this exception is throwed ?
this is my code.
public List<Block<T>> ReadBlock(int address)
{
    var result = new List<Block<T>>();
    using (var br = new BinaryReader(new FileStream(FilePath, FileMode.OpenOrCreate, FileAccess.Read),Encoding.Default))
    {
         var buffer = new byte[BlockSize];
         br.Read(buffer, address, BlockSize);

         if (buffer.Sum(item => item) == 0)
         {
            result.Add(new Block<T>());
         }
         else
         {
            var block = new Block<T>();
            block.Deserialize(buffer);
            result.Add(block);
         }
    }
    return result;
}

A:

This is because address is the starting point in the buffer.
So your buffer length is 489 but you are trying to fill it starting at index 978 (out of bounds)
You will want to use Seek to move to the offset (address) before filling your buffer
var buffer = new byte[BlockSise];

// go to offset address 
br.BaseStream.Seek(address, SeekOrigin.Begin);

// fill buffer from starting at address to address + BlockSise
br.Read(buffer, 0, BlockSise);

That will fill buffer with BlockSize bytes starting at address

