Package java.io

Examples of java.io.InvalidClassException


   * @throws InvalidClassException
   */
  public ConcurrentMessageListener(int concurrentThreads, Object delegateListener)
          throws InvalidClassException {
    if (!(delegateListener instanceof SessionAwareMessageListener)) {
      throw new InvalidClassException("Invalid Delegate Listener. Expected Object of Type:"
              + SessionAwareMessageListener.class + " Received:" + delegateListener.getClass());
    }
    concurrentThreadCount = concurrentThreads;
    this.delegateListener = (SessionAwareMessageListener) delegateListener;
    if (concurrentThreads > 1) {
View Full Code Here


    {
      obj = objIn.readObject();
    }
    catch (ClassNotFoundException ex)
    {
      throw new InvalidClassException(ex.toString());
    }
   
    return obj;
  }
View Full Code Here

  public static wmo load(ByteBuffer databuffer) throws InvalidClassException, ChunkNotFoundException {
    // get mver
    try {
      MVER mver = new MVER(databuffer);
    } catch(ChunkNotFoundException e) {
      throw new InvalidClassException(e.getMessage());
    }
     
    if(chunk.nextChunk(databuffer).compareTo("DHOM")==0) {
      // root file
      databuffer.position(0);
View Full Code Here

      if(databuffer.hasRemaining()
             && chunk.nextChunk(databuffer).compareTo("VCOM")==0) mocv = new MOCV(databuffer);
      if(databuffer.hasRemaining()
             && chunk.nextChunk(databuffer).compareTo("QILM")==0) mliq = new unkChunk(databuffer, "QLIM");
    } catch(ChunkNotFoundException e) {
      throw new InvalidClassException(e.getMessage());
    }


  }
View Full Code Here

        modf = new MODF(buff);
      }
      else
        modf=new MODF();
    } catch (ChunkNotFoundException e) {
      throw new InvalidClassException(e.getMessage());
    }
  }
View Full Code Here

    // setup data
    super(databuffer);
   
    //check magic ...
    if(getMagic().compareTo("WDBC") != 0) {
       throw new InvalidClassException("Invalid DBC data!");
    }
   
    // save our bytelenght for internal calculations
    rl = getRecordSize()/getNFields();
 
View Full Code Here

  private boolean load(ByteBuffer databuffer) throws InvalidClassException {
    // read the version and the header
    try {
      info = new MVER(buff);
    } catch (ChunkNotFoundException e) {
      throw new InvalidClassException("No ADT Version found.");
    }
   
    try {
      header = new MHDR(buff);
    } catch (ChunkNotFoundException e) {
      throw new InvalidClassException("No ADT Headers found.");
    }

    checkVersion();

    // load stuff using the offsets
    int base_offs = header.getBaseOffs();

    try {
      buff.position(base_offs + header.getInfoOffs());
      fieldInfo = new MCIN(buff);

      buff.position(base_offs + header.getTexOffs());
      mtex = new MTEX(buff);

      buff.position(base_offs + header.getModelOffs());
      mmdx = new MMDX(buff);
      buff.position(base_offs + header.getModelIDOffs());
      mmid = new MMID(buff);

      buff.position(base_offs + header.getMapObjOffs());
      mwmo = new MWMO(buff);
      buff.position(base_offs + header.getMapObjIDOffs());
      mwid = new MWID(buff);

      buff.position(base_offs + header.getDooDsDefOffs());
      mddf = new MDDF(buff);
      buff.position(base_offs + header.getObjDefOffs());
      modf = new MODF(buff);

      if (version_flag >= ADT_VERSION_EXPANSION_TBC)
        if (header.getoffsMH2O() != 0) {
          buff.position(base_offs + header.getoffsMH2O());
          mh2o = new unkChunk(buff, "O2HM");

        }
    } catch (ChunkNotFoundException e) {
      // TODO: try to find it manually
      throw new InvalidClassException(e.getMessage());
    }

    try {
      mcnk = new MCNK[256];
      for (int c = 0; c < 256; c++) {
        buff.position(fieldInfo.getOffs(c));
        mcnk[c] = new MCNK(buff, version_flag);
      }
    } catch (SubChunkNotFoundException e) {
      throw new InvalidClassException(e.getMessage());
    } catch (ChunkNotFoundException e) {
      // TODO: try to find it manually
      throw new InvalidClassException(e.getMessage());
    }

    if (version_flag >= ADT_VERSION_EXPANSION_TBC)
      try {
        if (header.getoffsFlightBoundary() != 0) {
          buff.position(base_offs + header.getoffsFlightBoundary());
          mfbo = new MFBO(buff);
        }
      } catch (ChunkNotFoundException e) {
        // TODO: try to find it manually
        throw new InvalidClassException(e.getMessage());
      }
     
    if (version_flag >= ADT_VERSION_EXPANSION_WOTLK){
      try{
        if (header.getoffsMTFX() != 0) {
          buff.position(base_offs + header.getoffsMTFX());
          mtfx = new MTFX(buff);
        }
      }
      catch(ChunkNotFoundException e){
        // TODO: try to find it manually
        throw new InvalidClassException(e.getMessage());
      }
    }

    // clean return
    buff.limit(buff.position());
View Full Code Here

    // read the version and the header
    buff.position(0);
    try {
      info = new MVER(buff);
    } catch (ChunkNotFoundException e) {
      throw new InvalidClassException("No ADT Version found.");
    }
   
    try {
      header = new MHDR(buff);
    } catch (ChunkNotFoundException e) {
      throw new InvalidClassException("No ADT Headers found.");
    }

    checkVersion();

      fieldInfo = new MCIN(buff);
View Full Code Here

    else {
      System.err.println("Version " + mver.getVersion() + " is not supported.");
      return;
    }
    } catch(ChunkNotFoundException e) {
      throw new InvalidClassException(e.getMessage());
    }
  }
View Full Code Here

    header = new Header(buff);
   
   
    // check magic
    if(header.getMagic().compareTo("MD20") != 0) {
      throw new InvalidClassException("Invalid m2 Data.");
    }
   
    // check version
    byte version[] = header.getVersion();
   
View Full Code Here

TOP

Related Classes of java.io.InvalidClassException

Copyright © 2018 www.massapicom. 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.