code: public static void setNovalueBorder( WritableRaster raster ) {
          int width = raster.getWidth();
          int height = raster.getHeight();
  
          for( int c = 0; c < width; c++ ) {
              raster.setSample(c, 0, 0, doubleNovalue);
              raster.setSample(c, height - 1, 0, doubleNovalue);
          }
          for( int r = 0; r < height; r++ ) {
              raster.setSample(0, r, 0, doubleNovalue);
              raster.setSample(width - 1, r, 0, doubleNovalue);
          }
      }
docs: Creates a border of novalues.
  
  @param raster the raster to process.