code: static int getWireFormatForFieldType(final WireFormat.FieldType type, boolean isPacked) {
          if (isPacked) {
              return WireFormat.WIRETYPE_LENGTH_DELIMITED;
          } else {
              return type.getWireType();
          }
      }
docs: Given a field type, return the wire type.
  
  @param type the type
  @param isPacked the is packed
  @return the wire format for field type
  @returns One of the {@code WIRETYPE_} constants defined in {@link WireFormat}.