Logo Search packages:      
Sourcecode: libloader version File versions  Download package

byte [] org::jfree::resourceloader::loader::AbstractResourceData::getResource ( ResourceManager  caller  )  throws ResourceLoadingException [inline, inherited]

This is dangerous, especially if the resource is large.

Parameters:
caller 
Returns:
Exceptions:
ResourceLoadingException 

Implements org::jfree::resourceloader::ResourceData.

Definition at line 54 of file AbstractResourceData.java.

  {
    try
    {
      final InputStream in = getResourceAsStream(caller);
      if (in == null)
      {
        throw new ResourceLoadingException("Unable to read Stream: No input stream: " + getKey());
      }
      final ByteArrayOutputStream bout = new ByteArrayOutputStream();
      IOUtils.getInstance().copyStreams(in, bout);
      in.close();
      return bout.toByteArray();
    }
    catch (ResourceLoadingException rle)
    {
      throw rle;
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read Stream: ", e);
    }
  }


Generated by  Doxygen 1.6.0   Back to index