question about classloader, jars, applets and loading external data

I have a question about classloader system used in applets:

Let’s imagine that i have created some applet which on its own downloads some jar ( app connects to server and download jar in its own thread

  • using urlConnection.getInputStream() etc. ) . In this loaded jar i have some data for example images sound and java class files.
    And my questions are:
  1. If in my applet I will download some image (which is stored in previous loaded jar) using getImage() func what will happen. For example will jvm search
    this image in all jars that i downloaded in app or will it immediately start downloading it from server ?

  2. The same question is about other data which can be accessed using class.getResourceAsStream() or java class files using Class.forName() func , will jvm first search resource in all jars and then try in server.

  3. Or maybe I must add to applet tag what jars i will be using if I want to use these above ideas for example like this:

                     <applet code="app.class">
                              <PARAM NAME="archive"     VALUE="appMain.jar  ,   images.jar   ,   binaryData.jar ">
                     </applet> 
    

Can anyone answer ???

I am not 100% sure i udneratdn you.

If you open a jar as a stream from an HTTP server in your code it is no different from any other input atrea, It will not be used by the classlaoder because the classloader is totally unaware of it.,

If you want resources out of such a stream then you need to ;parse it using JarStream and JarEntry to find the entry yo uwant, then load it.

Alternatrely, if you already know the name of the entry yo uwant from the Jar file you can simply open the entry by using JarURLConnection. Look at the javadocs for the syntax to use to open an entry in a Jar as its own stream.