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

📄 jarreader.java

📁 有关j2me的很好的例子可以研究一下
💻 JAVA
字号:
/** * * @(#)JarReader.java	1.4 01/03/29 * * Copyright 2001 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. */package com.sun.midp.midletsuite;import java.lang.String;import java.io.IOException;import com.sun.midp.security.SecurityDomain;import com.sun.midp.security.Actions;import com.sun.midp.io.j2me.storage.File;/** * This class provides a Java API for reading an entry from a Jar file stored * on the file system. */class JarReader {    /**     * Returns the content of the given entry in the JAR file on the     * file system given by jarFilePath.     *     * @param securityDomain domain with permision to install software     * @param jarFilePath file pathname of the JAR file to read. May     *          be a relative pathname.     * @param entryName name of the entry to return.     *     * @return the content of the given entry in a byte array.     * @exception IOException if the entry does not exist.     * @exception SecurityException if the caller does not have permission     *   to install software.     */    static byte[] readJarEntry(SecurityDomain securityDomain,                               String jarFilePath, String entryName)            throws IOException {        byte[] asciiFilename;        byte[] asciiEntryName;        securityDomain.checkIfPermitted(Actions.LIFECYCLE_MANAGEMENT);                asciiFilename = File.toCString(jarFilePath);        asciiEntryName = File.toCString(entryName);        return readJarEntry0(asciiFilename, asciiEntryName);    }    /**     * Performs the same function as readJarEntry, except file names     * are passed in localized characters (so that unicode -> "C" string     * conversion does not need to happen inside native code).     *     * @param localJarFilePath file pathname of the JAR file to read. May     *          be a relative pathname.     * @param localEntryName name of the entry to return.     *     * @return the content of the given entry in a byte array.     * @exception IOException if the entry does not exist.     */    private static native byte[] readJarEntry0(byte[] localJarFilePath,                                        byte[] localEntryName)        throws IOException;}

⌨️ 快捷键说明

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