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

int org::jfree::resourceloader::loader::raw::RawResourceData::getResource ( final ResourceManager  caller,
final byte[]  target,
final int  offset,
final int  length 
) throws ResourceLoadingException [inline]

Tries to read data into the given byte-array.

Parameters:
caller 
target 
offset 
length 
Returns:
the number of bytes read or -1 if no more data can be read.
Exceptions:
org.jfree.resourceloader.ResourceLoadingException 

Definition at line 84 of file RawResourceData.java.

  {
    if (offset > data.length)
    {
      return -1;
    }

    final int remaining = data.length - offset;
    final int maxReadable = Math.min(target.length, Math.min (remaining, length));

    System.arraycopy(data, offset, target, 0, maxReadable);
    return maxReadable;
  }


Generated by  Doxygen 1.6.0   Back to index