title: C# Protobuf: 'Protocol message contained a tag with an invalid wire type.'
body: <p>I am trying to read some protobuf data from a collegue - he created it in C++ and set the encoding to unicode, and transfer mode for protobuf is binary.</p>
  
  <p>In python, this works perfectly:</p>
  
  <pre><code>with open('test.out', 'rb') as f:
      dfile = protoclass_pb2.DataFile()
      dfile.ParseFromString(f.read())
      print(dfile.MetaData.author)
  </code></pre>
  
  <p>just like a charm.</p>
  
  <p>In C# howevern, I try:</p>
  
  <pre><code>string filepath = "test.out"
  FileStream fst = new FileStream(filepath, 
  DataFile data = DataFile.Parser.ParseDelimitedFrom(fst);
  fst.Close();
  </code></pre>
  
  <p>and get the Exception:</p>
  
  <pre><code>Google.Protobuf.InvalidProtocolBufferException: 'Protocol message contained a tag with an invalid wire type.'
  </code></pre>
  
  <p>I tired somehow setting an encoding to the stream, but as far I can tell, I can only set encoding to <code>StreamReader</code> but not <code>Stream</code> itself.</p>
  
  <p>Just reading the file content to an array produces the same in both languages.</p>
  
  <p>How can I read the data in to C#?</p>