code: private static FieldInfo readFieldInfo(BigEndianBinaryReader in) throws IOException {
          byte type = in.expectByte();
          if (type == BinaryType.STOP) {
              return null;
          }
          return new FieldInfo(in.expectShort(), type);
      }
docs: Read field info from stream. If this is the last field (field ID 0)
  return null.
  
  @param in The stream to consume.
  @return The field info or null.
  @throws IOException If read failed.