GridCoverage[] coverages = (GridCoverage[]) value;
// grab the delegate for coverage encoding
GetCoverageType request = (GetCoverageType) operation.getParameters()[0];
String outputFormat = request.getOutput().getFormat().getValue();
CoverageResponseDelegate delegate = getResponseDelegate(outputFormat);
// grab the coverage info for Coverages document encoding
final GridCoverage2D coverage = (GridCoverage2D) coverages[0];
// ImageIOUtilities.visualize(coverage.getRenderedImage());
// write the coverage
try {
delegate.encode(coverage, outputFormat,Collections.EMPTY_MAP, output);
output.flush();
} finally {
// if(output != null) output.close();
}
}