Package java.io

Examples of java.io.DataInputStream.skipBytes()


                    } // 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);
View Full Code Here


                // dis.skipBytes(2);
                float baySize = readFloat(dis);

                // bay name (this is free text, so we can't be certain if it is
                // an infantry bay or something else)
                dis.skipBytes(readUnsignedShort(dis));

                // Add the troopSpace of this bay to our running total.
                troopSpace += baySize;

            } // Handle the next bay.
View Full Code Here

                // Add the troopSpace of this bay to our running total.
                troopSpace += baySize;

            } // Handle the next bay.

            dis.skipBytes(12);
            int CASE = readUnsignedShort(dis);
            if (CASE == 0xFFFF) {
                if (techType.equals(HMVTechType.INNER_SPHERE)) {
                    addEquipmentType(EquipmentType.get("ISCASE"), 1,
                            HMVWeaponLocation.REAR);
View Full Code Here

            artemisType = readUnsignedShort(dis);
            // the artemis is a bit field: 1 = SRM artemis IV, 2 = LRM artemis
            // IV,
            // 4 = SRM artemis V, 8 = LRM artemis V
            dis.skipBytes(4);
            int VTOLoptions = readUnsignedShort(dis);
            // Yuck, a decimal field: 10 = main/tail, 20 = dual, 30 = coax
            // rotors
            // 100 = beagle/clan AP, 200 = bloodhound/light AP, 300 = c3 slave
            // mast mount
View Full Code Here

                }
            } else if (mastEq == 3) {
                addEquipmentType(EquipmentType.get("ISC3SlaveUnit"), 1,
                        HMVWeaponLocation.TURRET);
            }
            dis.skipBytes(4);

            int fluffSize = 0;
            fluff = "Overview:\n\r";
            buffer = new byte[readUnsignedShort(dis)];
            dis.read(buffer);
View Full Code Here

            buffer = new byte[readUnsignedShort(dis)];
            dis.read(buffer);
            fluff += new String(buffer);
            fluffSize += new String(buffer).length();

            dis.skipBytes(readUnsignedShort(dis)); // notes

            // just a catch all for small Fluffs anything well less then 10
            // characters, per section, isn't worth printing.
            if (fluffSize <= 60) {
                fluff = null;
View Full Code Here

    if (packet_type.equals("HSID")) {
//      if (this.received_hsid_packet == false)
//        logger.fine("Received first HSID packet");
     
      DataInputStream data_stream = new DataInputStream(new ByteArrayInputStream(sim_data));   
      data_stream.skipBytes(4)// skip the bytes containing the packet type id
      int nb_of_data_points = (int) data_stream.readFloat();
     
      // Reads the HSID data und deploys them into the data repository
      for (int i=0;i<nb_of_data_points;i++) {
        int data_point_id = (int) data_stream.readFloat();
View Full Code Here

    } else if (packet_type.equals("FMSE")) {
//      if (this.received_fms_packet == false)
//        logger.fine("Received first FMSE packet");

      DataInputStream data_stream = new DataInputStream(new ByteArrayInputStream(sim_data));   
      data_stream.skipBytes(4)// skip the bytes containing the packet type id 

      this.fms.clear();
     
      int nb_of_entries = (int) data_stream.readFloat();
     
View Full Code Here

      data_stream.skip(4);    // don't evaluate destination entry index. This info is determined by is_active flag"
     
      for (int i=0;i<nb_of_entries;i++) {
        int type = (int) data_stream.readFloat();
        String id = new String(sim_data,((i*24))+20,5).trim()
        data_stream.skipBytes(8);
        float altitude = data_stream.readFloat();
        float lat = data_stream.readFloat();
        float lon = data_stream.readFloat();
        boolean is_active = (i == active_entry_index);
   
View Full Code Here

   */
  public static double[] readDouble(String file, int first, int skipBytes, int length) throws IOException{
    double[] data = new double[length];
    DataInputStream in = new DataInputStream(new FileInputStream(file));
    //find the first double to read in
    in.skipBytes(first);
    data[0] = in.readDouble();
    for(int i=1; i<length; ++i){
      in.skipBytes(skipBytes);
      data[i] = in.readDouble();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.