private Style createRGBStyle(AbstractGridCoverage2DReader reader,WritableRaster raster){
  RasterSymbolizer sym=sf.getDefaultRasterSymbolizer();
  GridCoverage2D cov=null;
  try {
    cov=reader.read(null);
  }
 catch (  IOException giveUp) {
    throw new RuntimeException(giveUp);
  }
  int numBands=cov.getNumSampleDimensions();
  if (numBands < 3) {
    createRGBImageSymbol(sym,cov,raster);
  }
 else {
    createRGBChannelSymbol(sym,cov,numBands);
  }
  return SLD.wrapSymbolizers(sym);
}

private Style createRGBStyle ( AbstractGridCoverage2DReader reader , WritableRaster raster ) { RasterSymbolizer sym = sf . getDefaultRasterSymbolizer ( ) ; GridCoverage2D cov = null ; try { cov = reader . read ( null ) ; } catch ( IOException giveUp ) { throw new RuntimeException ( giveUp ) ; } int numBands = cov . getNumSampleDimensions ( ) ; if ( numBands < 3 ) { createRGBImageSymbol ( sym , cov , raster ) ; } else { createRGBChannelSymbol ( sym , cov , numBands ) ; } return SLD . wrapSymbolizers ( sym ) ; }
creates the rgb style .
