code: public static WritableRaster createWritableRasterFromArray( int width, int height, int[] pixels ) {
          WritableRaster writableRaster = createWritableRaster(width, height, null, null, null);
          int index = 0;
          for( int y = 0; y < height; y++ ) {
              for( int x = 0; x < width; x++ ) {
                  double value = (double) pixels[index];
                  if (value == 0) {
                      value = doubleNovalue;
                  }
                  writableRaster.setSample(x, y, 0, value);
                  index++;
              }
          }
          return writableRaster;
      }
docs: Create a {@link WritableRaster} from a int array.
  
  @param width the width of the raster to create.
  @param height the height of the raster to create.
  @param pixels the array of data.
  @return the produced raster.