title: Protocol message contained an invalid tag (zero)
body: <p>I'm working with pbf files from the open street maps </p>
  
  <p>I want to parse node, relations, and ways. </p>
  
  <p>when I try to parse nodes I get that message. </p>
  
  <p>The code looks like </p>
  
  <pre><code>package myCode;
  
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.util.List;
  
  import protpbufCode.OsmPbf;
  import protpbufCode.OsmPbf.Node;
  import protpbufCode.OsmPbf.PrimitiveGroup;
  
  
  public class ReadingPBF 
  {
  
       public static void print(PrimitiveGroup node)
        {
             for (Node m: node.getNodesList()) 
              {
                System.out.print("Person ID: " + m.getId() + " ");
                System.out.print("  Lat: " + m.getLat()+ " ");
                System.out.print(" Long: "+ m.getLon()+ " ");
                System.out.println("");
  
              }
        }
  
  
      public static void main (String args[])
      {
          try 
          {
              PrimitiveGroup newNode = PrimitiveGroup.parseFrom(new FileInputStream(new         File("isle.pbf")));
              print(newNode);
          }
          catch (IOException e) 
          {
              // TODO Auto-generated catch block
              e.printStackTrace();
              System.out.println(e.getMessage());
              System.out.println(e.getCause());
          }
  
  
  
      }
  }
  </code></pre>
  
  <p>the OsmPbf is java class that created using the protobuf compiler. </p>
  
  <p>and that what gets printed. </p>
  
  <pre><code>com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
  at     com.google.protobuf.InvalidProtocolBufferException.invalidTag(InvalidProtocolBufferException.java:89)
  at com.google.protobuf.CodedInputStream.readTag(CodedInputStream.java:158)
  at protpbufCode.OsmPbf$PrimitiveGroup.&lt;init&gt;(OsmPbf.java:5230)
  at protpbufCode.OsmPbf$PrimitiveGroup.&lt;init&gt;(OsmPbf.java:5219)
  at protpbufCode.OsmPbf$PrimitiveGroup$1.parsePartialFrom(OsmPbf.java:5329)
  at protpbufCode.OsmPbf$PrimitiveGroup$1.parsePartialFrom(OsmPbf.java:1)
  at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:192)
  at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:209)
  at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:215)
  at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49)
  at protpbufCode.OsmPbf$PrimitiveGroup.parseFrom(OsmPbf.java:5627)
  at myCode.ReadingPBF.main(ReadingPBF.java:33)
  
  
  Protocol message contained an invalid tag (zero).
  
  null
  </code></pre>