Code example for Blob

Methods: getBytes, length

0
    else if (o instanceof Blob)
    { 
      try 
      { 
        final Blob b = (Blob) o;
        final byte[] data = b.getBytes(1, (int) b.length());
        final ResourceManager resManager = runtime.getProcessingContext().getResourceManager();
        final Resource resource = resManager.createDirectly(data, DrawableWrapper.class);
        return resource.getResource();
      } 
      catch (Exception e)
      { 
        if (DrawableLoadFilter.logger.isDebugEnabled())
        { 
          DrawableLoadFilter.logger.warn("Error while loading the drawable from an blob", e);
        } 
        else if (DrawableLoadFilter.logger.isWarnEnabled())
        { 
          DrawableLoadFilter.logger.warn("Error while loading the drawable from an blob: " + e);
        } 
        return null;