// Create a file object from the file name provided.
file = new File(fileName);
// Build the task object.
try {
BlockOutputStream output = new BlockOutputStream(
new FileOutputStream(file));
task = new OsmosisSerializer(output);
task.configBatchLimit(this.getIntegerArgument(taskConfig,
"batchlimit", 8000));
task.configOmit(this.getBooleanArgument(taskConfig, "omitmetadata",
false));
task.setUseDense(this.getBooleanArgument(taskConfig, "usedense",
true));
task.configGranularity(this.getIntegerArgument(taskConfig,
"granularity", 100));
output.setCompress(this.getStringArgument(taskConfig, "compress",
"deflate"));
} catch (FileNotFoundException e) {
throw new OsmosisRuntimeException("Failed to initialize Osmosis pbf serializer.", e);
}