@Override
protected final void runTile(int tileLeftX, int tileTopY, int tileWidth, int tileHeight, int localRowIndex, int localColumnIndex)
throws IOException, IllegalAccessException, InterruptedException {
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "");
logger.log(Level.FINE, "Write mask values for tile region: row index: "+ localRowIndex+", column index: "+localColumnIndex+", bounds [x=" + tileLeftX+", y="+tileTopY+", width="+tileWidth+", height="+tileHeight+"]");
}
File nodesFile = AbstractWriteMasksTilesComputing.computeMaskTilePath(this.temporaryFolder, tileLeftX, tileTopY, tileWidth, tileHeight).toFile();
BufferedOutputStreamWrapper outputFileStream = null;
try {
outputFileStream = new BufferedOutputStreamWrapper(nodesFile);
int tileBottomY = tileTopY + tileHeight;
int tileRightX = tileLeftX + tileWidth;
for (int y = tileTopY; y < tileBottomY; y++) {
for (int x = tileLeftX; x < tileRightX; x++) {
outputFileStream.writeBoolean(isValidMaskPixel(x, y));
}
}
} finally {
if (outputFileStream != null) {
try {
outputFileStream.close();
} catch (IOException exception) {
}
}
}
}