@Test
    void test() throws Exception {
        final File[] testFile = new File[4];
        testFile[0] = writeFile(32, ByteOrder.LITTLE_ENDIAN, false);
        testFile[1] = writeFile(32, ByteOrder.BIG_ENDIAN, false);
        testFile[2] = writeFile(32, ByteOrder.LITTLE_ENDIAN, true);
        testFile[3] = writeFile(32, ByteOrder.BIG_ENDIAN, true);
        for (int i = 0; i < testFile.length; i++) {
            final String name = testFile[i].getName();
            final ByteSource byteSource = ByteSource.file(testFile[i]);
            final TiffReader tiffReader = new TiffReader(true);
            final TiffContents contents = tiffReader.readDirectories(byteSource, true, // indicates that application should read image data, if present
                    FormatCompliance.getDefault());
            final TiffDirectory directory = contents.directories.get(0);
            final AbstractTiffRasterData rdInt = directory.getRasterData(null);
            final int[] test = rdInt.getIntData();
            for (int j = 0; j < sample.length; j++) {
                assertEquals(sample[j], test[j], "Extracted data does not match original, test " + name + ": " + i + ", index " + j);
            }
            final TiffImagingParameters params = new TiffImagingParameters();
            params.setSubImage(2, 2, width - 4, height - 4);
            final AbstractTiffRasterData rdSub = directory.getRasterData(params);
            assertEquals(width - 4, rdSub.getWidth(), "Invalid sub-image width");
            assertEquals(height - 4, rdSub.getHeight(), "Invalid sub-image height");
            for (int x = 2; x < width - 2; x++) {
                for (int y = 2; y < height - 2; y++) {
                    final int a = rdInt.getIntValue(x, y);
                    final int b = rdSub.getIntValue(x - 2, y - 2);
                    assertEquals(a, b, "Sub Image test failed at (" + x + "," + y + ")");
                }
            }
            final TiffImagingParameters xparams = new TiffImagingParameters();
            xparams.setSubImage(2, 2, width, height);
            assertThrows(ImagingException.class, () -> directory.getRasterData(xparams), "Failed to catch bad subimage for test " + name);
        }
    }
Gets the bytes for output for a 16 bit floating point format. Note that this method operates over "blocks" of data which may represent either TIFF Strips
or Tiles. When processing strips, there is always one column of blocks and each strip is exactly the full width of the image. When processing tiles,
there may be one or more columns of blocks and the block coverage may extend beyond both the last row and last column.

@param s            an array of the grid of output values in row major order
@param width        the width of the overall image
@param height       the height of the overall image
@param nRowsInBlock the number of rows in the Strip or Tile
@param nColsInBlock the number of columns in the Strip or Tile
@param byteOrder    little-endian or big-endian
@return a two-dimensional array of bytes dimensioned by the number of blocks and samples
src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundTripInt32Test.java