.get( "CLHeavyMG Ammo (100)" );
.get( "CLHeavyMG Ammo (50)" );
  public HmvFile(InputStream is)    throws EntityLoadingException  {    try    {      DataInputStream dis = new DataInputStream(is);      byte[] buffer = new byte[5];      dis.read(buffer);      String version = new String(buffer);      // ??      dis.skipBytes(2);      int type = readUnsignedShort(dis);      movementType = HMVMovementType.getType( type );      if ( null == movementType ) {          throw new EntityLoadingException              ( "Could not locate movement type for " + type + "." );      }      // ??      dis.skipBytes(12);      buffer = new byte[readUnsignedShort(dis)];      dis.read(buffer);      name = new String(buffer);      buffer = new byte[readUnsignedShort(dis)];      dis.read(buffer);      model = new String(buffer);      rulesLevel = readUnsignedShort(dis);      year = readUnsignedShort(dis);      // ??      dis.skipBytes(32);      // The "bf2" buffer contains the word "omni" for OmniVehicles.      int bf2Length = readUnsignedShort(dis);      byte[] bf2Buffer = new byte[ bf2Length ];      dis.read( bf2Buffer );      isOmni = containsOmni( bf2Buffer );      techType = HMVTechType.getType(readUnsignedShort(dis));      // ??      dis.skipBytes(4);      engineRating = readUnsignedShort(dis);      engineType = HMVEngineType.getType(readUnsignedShort(dis));      cruiseMP = readUnsignedShort(dis);      jumpMP = readUnsignedShort(dis);      heatSinks = readUnsignedShort(dis);      heatSinkType = HMVHeatSinkType.getType(readUnsignedShort(dis));      roundedInternalStructure = readUnsignedShort(dis);      turretArmor = readUnsignedShort(dis);      // internal structure again ??      dis.skipBytes(2);      frontArmor = readUnsignedShort(dis);      // internal structure again ??      dis.skipBytes(2);      leftArmor = readUnsignedShort(dis);      // internal structure again ??      dis.skipBytes(2);      rightArmor = readUnsignedShort(dis);      // internal structure again ??      dis.skipBytes(2);      rearArmor = readUnsignedShort(dis);      // ??      if ( isOmni ) {          // Skip 12 bytes for OmniVehicles          dis.skipBytes(12);      } else {          // Skip 14 bytes for non-OmniVehicles          dis.skipBytes(14);      }      int weapons = readUnsignedShort(dis);      for (int i = 1; i <= weapons; i++)      {        int weaponCount = readUnsignedShort(dis);        int weaponType = readUnsignedShort(dis);        // manufacturer name        dis.skipBytes(readUnsignedShort(dis));        HMVWeaponLocation weaponLocation =          HMVWeaponLocation.getType(readUnsignedShort(dis));        int weaponAmmo = readUnsignedShort(dis);        EquipmentType equipmentType = getEquipmentType(weaponType, techType);        if (equipmentType != null)        {            addEquipmentType(equipmentType, weaponCount, weaponLocation);            if (weaponAmmo > 0)            {                AmmoType ammoType = getAmmoType(weaponType, techType);                if (ammoType != null)                {                    // Need to play games for half ton MG ammo.                    if ( weaponAmmo < ammoType.getShots() ||                         weaponAmmo % ammoType.getShots() > 0 ) {                        switch ( ammoType.getAmmoType() ) {                        case AmmoType.T_MG:                            if ( ammoType.getTechLevel() ==                                 TechConstants.T_IS_LEVEL_1 ) {                                ammoType = (AmmoType) EquipmentType                                    .get( "ISMG Ammo (100)" );                            } else {                                ammoType = (AmmoType) EquipmentType                                    .get( "CLMG Ammo (100)" );                            }                            break;                        case AmmoType.T_MG_LIGHT:                            ammoType = (AmmoType) EquipmentType                                .get( "CLLightMG Ammo (100)" );                            break;                        case AmmoType.T_MG_HEAVY:                            ammoType = (AmmoType) EquipmentType                                .get( "CLHeavyMG Ammo (100)" );                            break;                        default:                            // Only MG ammo comes in half ton lots.                            throw new EntityLoadingException                                ( ammoType.getName() +                                  " has " + ammoType.getShots() +                                  " shots per ton, but " + name + " " + model +                                  " wants " + weaponAmmo + " shots." );                        }                    }                    // Add as many copies of the AmmoType as needed.                    addEquipmentType(ammoType,                                     weaponAmmo / ammoType.getShots(),                                     HMVWeaponLocation.BODY);                } // End found-ammoType            } // End have-rounds-of-ammo        } // End found-equipmentType        // ??        dis.skipBytes(4);      } // Handle the next piece of equipment      // Read the amount of troop/cargo bays.      int bayCount = readUnsignedShort(dis);      for ( int loop = 0; loop < bayCount; loop++ ) {          // Read the size of this bay.          dis.skipBytes(2);          int baySizeCode = readUnsignedShort(dis);          // manufacturer name          dis.skipBytes(readUnsignedShort(dis));          // Add the troopSpace of this bay to our running total.          switch ( baySizeCode ) {          case 0x3F80:  // 1 ton          case 0x4020:  // 1 ton???              troopSpace += 1;              break;          case 0x4040:  // 3 tons          case 0x4060:  // 3.5 tons              troopSpace += 3;              break;          case 0x4080:  // 4 tons              troopSpace += 4;              break;          case 0x40A0:  // 5 tons              troopSpace += 5;              break;          case 0x40C0:  // 6 tons              troopSpace += 6;              break;          case 0x40F0:  // 7.5 tons              troopSpace += 7;              break;          case 0x4100:  // 8 tons???              troopSpace += 8;              break;          }      } // Handle the next bay.      dis.close();    }    catch (IOException ex)    {        ex.printStackTrace();        throw new EntityLoadingException("I/O Error reading file");    }  }