if( conn.getResponseCode() != 200
|| contentType != null && !contentType.startsWith("image") )
throw new IOException(readException(conn));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (InputStream is = new ProgressInputStream(conn, null)) {
Utils.copyStream(is, baos);
}
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
BufferedImage img = layer.normalizeImage(ImageProvider.read(bais, true, WMSLayer.PROP_ALPHA_CHANNEL.get()));