title: Using BinaryWriter to seek and insert data
body: <p>Background:</p>
  
  <p>I'm fairly new to C# and currently working on a project intended primarily for learning.  I am creating a library to work with .PAK files, as used by Quake and Quake II.  I can read and extract them fine, as well as writing a blank archive, and I'm on to writing data to the archive.</p>
  
  <p>The basic specification can be found here for reference: <a href="http://debian.fmi.uni-sofia.bg/~sergei/cgsr/docs/pak.txt" rel="nofollow">http://debian.fmi.uni-sofia.bg/~sergei/cgsr/docs/pak.txt</a></p>
  
  <p>Issue:</p>
  
  <p>I would like to seek to the end of the binary data portion and insert data from a given file.  I use BinaryWriter in the method when creating an empty file, so this is what I'm looking to use for insertion.  From what I found, seeking and writing with BinaryWriter will write at a given position and overwrite existing data.</p>
  
  <p>My goal is to simply insert data at a given point without losing any existing data.  If this is not possible, I imagine that I will need to extract the entire index containing the individual file information (name, offset, length), add binary data, then append the index and append information for the file I am writing.</p>
  
  <p>Any thoughts or suggestions?</p>