⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appletlib.java

📁 Java游戏高级编程!!很不错的!!!Java游戏高级编程!!很不错的
💻 JAVA
字号:
     package com.croftsoft.core.applet;     import java.applet.*;     import java.io.*;     import java.util.zip.*;     import com.croftsoft.core.io.SerializableLib;     import com.croftsoft.core.lang.NullArgumentException;     /*********************************************************************     * Static library methods for manipulating Applets.     *     * @version     *   2003-03-14     * @since     *   2002-12-22     * @author     *   <a href="http://www.croftsoft.com/">David Wallace Croft</a>     *********************************************************************/     public final class  AppletLib     //////////////////////////////////////////////////////////////////////     //////////////////////////////////////////////////////////////////////     {     /*********************************************************************     * Loads GZIP compressed data.     *********************************************************************/     public static Serializable  loadSerializableUsingAppletPersistence (       Applet  applet,       String  key )       throws ClassNotFoundException, IOException,         UnsupportedOperationException     //////////////////////////////////////////////////////////////////////     {       NullArgumentException.check ( applet, "null applet" );       NullArgumentException.check ( key, "null key" );       AppletContext  appletContext = null;       try       {         appletContext = applet.getAppletContext ( );       }       catch ( NullPointerException  ex )       {       }       if ( appletContext == null )       {         throw new UnsupportedOperationException ( "null AppletContext" );       }       InputStream  inputStream = appletContext.getStream ( key );       if ( inputStream == null )       {         return null;       }       return SerializableLib.load ( inputStream );     }     /*********************************************************************     * Saves data using GZIP compression.     *********************************************************************/     public static void  saveSerializableUsingAppletPersistence (       Applet        applet,       String        key,       Serializable  serializable )       throws IOException, UnsupportedOperationException     //////////////////////////////////////////////////////////////////////     {       NullArgumentException.check ( applet, "null applet" );       NullArgumentException.check ( key, "null key" );       NullArgumentException.check ( serializable, "null serializable" );       AppletContext  appletContext = null;       try       {         appletContext = applet.getAppletContext ( );       }       catch ( NullPointerException  ex )       {       }       if ( appletContext == null )       {         throw new UnsupportedOperationException ( "null AppletContext" );       }       InputStream  inputStream = new ByteArrayInputStream (         SerializableLib.compress ( serializable ) );       appletContext.setStream ( key, inputStream );     }     //////////////////////////////////////////////////////////////////////     //////////////////////////////////////////////////////////////////////     private  AppletLib ( ) { }     //////////////////////////////////////////////////////////////////////     //////////////////////////////////////////////////////////////////////     }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -