FirePixelMapper extends Mapper<NullWritable, NullWritable, LongWritable, RasterStackWritable> { static void readData(Product uncertaintyProduct, Rectangle rectangle, byte[] uncertaintyPixels) throws IOException { Band classificationProductBand = uncertaintyProduct.getBand("band_1"); ProductData.Byte buffer = new ProductData.Byte(uncertaintyPixels); classificationProductBand.readRasterData(rectangle.x, rectangle.y, rectangle.width, rectangle.height, buffer); }  @Override void run(Context context);  }
@Test public void testMapData() throws IOException { short[] classificationPixels = new short[200]; FirePixelMapper.readData(product, new Rectangle(1193, 0, 200, 1), classificationPixels); assertEquals(-2, classificationPixels[0]); assertEquals(0, classificationPixels[7]); assertEquals(-1, classificationPixels[95]); assertEquals(28, classificationPixels[163]); assertEquals(28, classificationPixels[164]); }