Logo Search packages:      
Sourcecode: jamvm version File versions

InputStream java::lang::ClassLoader::getResourceAsStream ( String  name  )  [inline]

Get a resource as stream using this classloader or one of its parents. First calls getResource() and if that returns a URL to the resource then it calls and returns the InputStream given by URL.openStream().

Subclasses should not override this method but should override findResource() which is called by this method.

Parameters:
name the name of the resource relative to this classloader
Returns:
an InputStream to the resource, or null
Since:
1.1

Definition at line 649 of file ClassLoader.java.

References getResource().

  {
    try
      {
        URL url = getResource(name);
        if (url == null)
          return null;
        return url.openStream();
      }
    catch (IOException e)
      {
        return null;
      }
  }


Generated by  Doxygen 1.6.0   Back to index