final WaitingImageObserver obs = new WaitingImageObserver(image);
obs.waitImageLoaded();
final PngEncoder encoder = new PngEncoder(image,
PngEncoder.ENCODE_ALPHA, PngEncoder.FILTER_NONE, 5);
final byte[] data = encoder.pngEncode();
// write the encoded picture ...
final ContentItem dataFile = dataLocation.createItem
(dataNameGenerator.generateName("picture", "image/png"));