Package mage.util

Examples of mage.util.CopierObjectInputStream


  private Game loadGame() {
    try{
      InputStream file = new FileInputStream("saved/" + gameId.toString() + ".game");
      InputStream buffer = new BufferedInputStream(file);
      ObjectInput input = new CopierObjectInputStream(Main.classLoader, new GZIPInputStream(buffer));
      try {
        Game game = (Game)input.readObject();
        GameStates states = (GameStates)input.readObject();
        game.loadGameStates(states);
        return game;
      }
      finally {
        input.close();
      }
    }
    catch(ClassNotFoundException ex) {
      logger.log(Level.SEVERE, "Cannot load game. Class not found.", ex);
    }
View Full Code Here


    private Game loadGame(UUID gameId) {
        try{
            InputStream file = new FileInputStream("saved/" + gameId.toString() + ".game");
            InputStream buffer = new BufferedInputStream(file);
            ObjectInput input = new CopierObjectInputStream(Main.classLoader, new GZIPInputStream(buffer));
            try {
                Game loadGame = (Game)input.readObject();
                GameStates states = (GameStates)input.readObject();
                loadGame.loadGameStates(states);
                return loadGame;
            }
            finally {
                input.close();
            }
        }
        catch(ClassNotFoundException ex) {
            logger.fatal("Cannot load game. Class not found.", ex);
        }
View Full Code Here

TOP

Related Classes of mage.util.CopierObjectInputStream

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.