title: C# Reading, Modifying then writing binary data to file. Best convention?
body: <p>I'm new to programming in general (My understanding of programming concepts is still growing.). So this question is about learning, so please provide enough info for me to learn but not so much that I can't, thank you.
  (I would also like input on how to make the code reusable with in the project.)</p>
  
  <p>The goal of the project I'm working on consists of:</p>
  
  <ol>
  <li><p>Read binary file.</p></li>
  <li><p>I have known offsets I need to read to find a particular chunk of data from within this file.</p></li>
  <li><p>First offset is first 4 bytes(Offset for end of my chunk).</p></li>
  <li><p>Second offset is 16 bytes from end of file. I read for 4 bytes.(Gives size of chunk       in hex).</p></li>
  <li><p>Third offset is the 4 bytes following previous, read for 4 bytes(Offset for start of chunk in hex).</p></li>
  <li><p>Locate parts in the chunk to modify by searching ASCII text as well as offsets.</p></li>
  </ol>
  
  <p>Now I have the start offset, end offset and size of my chunk.
  This should allow me to read bytes from file into a byte array and know the size of the array ahead of time.</p>
  
  <p>(Questions: 1. Is knowing the size important? Other than verification. 2. Is reading part of a file into a byte array in order to change bytes and overwrite that part of the file the best method?)</p>
  
  <p>So far I have managed to read the offsets from the file using BinaryReader on a MemoryStream. I then locate the chunk of data I need and read that into a byte array.</p>
  
  <p>I'm stuck in several ways:</p>
  
  <ul>
  <li>What are the best practices for binary Reading / Writing?</li>
  <li>What's the best storage convention for the data that is read?</li>
  <li>When I need to modify bytes how do I go about that.</li>
  <li>Should I be using FileStream?</li>
  </ul>