コード例 #1
0
  /**
   * Get a named resource out of the JAR of this MIDlet suite.
   *
   * @param name name of the resource
   * @return raw bytes of the resource or null if not available
   */
  public byte[] getResource(String name) {
    if (name.charAt(0) == '/') {
      // the jar reader does not remove the leading '/'
      name = name.substring(1, name.length());
    }

    try {
      return JarReader.readJarEntry(
          classSecurityToken, getStorageRoot() + Installer.JAR_FILENAME, name);
    } catch (IOException e) {
      return null;
    }
  }