title: How to de-serialize the file in Java by using Protocol-buffer?
body: <p>Want to create a serialized file in C# and then want to de-serialize the same in Java. For this , i am using Protocol buffer library. Here want i have done:</p>
  <p>In C#, I added protobuf-net.dll and the class which is to be serialized is represented as:</p>
  <p><strong>Person.cs</strong></p>
  <pre><code> [ProtoBuf.ProtoContract]
   public class Person
   {
      [ProtoBuf.ProtoMember(1)]
      public int Id {get;set;}
      [ProtoBuf.ProtoMember(2)]
      public string Name { get; set; }
   }
  </code></pre>
  <p>and in the main method, serialized it like this:</p>
  <pre><code> var person = new Person
      {
          Id = 12345,
          Name = &quot;Fred&quot;,
      };
    using (var file = File.Create(&quot;somepath\\person.bin&quot;))
      {
          Serializer.Serialize(file, person);
      }
  </code></pre>
  <p>This bin file i copied and pulled in the ecilpse filesystem- android /sdcard and tried to de-serialize it</p>
  <p><strong>In eclipse -JAVA,</strong></p>
  <p>Added protobuf.jar, external library and created person.proto file which contains:</p>
  <pre><code>message Person{
  required int32 Id=1;
  required string Name=2;
  }
  </code></pre>
  <p>Can anyone please suggest how to de-serialize the object which was created in the C#?</p>