public void setImageBytes(Resource buffer) throws GeoWebCacheException {
Assert.notNull(buffer, "WMSMetaTile.setImageBytes() received null");
Assert.isTrue(buffer.getSize() > 0, "WMSMetaTile.setImageBytes() received empty contents");
try {
ImageInputStream imgStream;
imgStream = new ResourceImageInputStream(((ByteArrayResource) buffer).getInputStream());
RenderedImage metaTiledImage = ImageIO.read(imgStream);// read closes the stream for us
setImage(metaTiledImage);
} catch (IOException ioe) {
throw new GeoWebCacheException("WMSMetaTile.setImageBytes() "