本文整理汇总了Java中org.embulk.spi.util.FileOutputOutputStream类的典型用法代码示例。如果您正苦于以下问题:Java FileOutputOutputStream类的具体用法?Java FileOutputOutputStream怎么用?Java FileOutputOutputStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileOutputOutputStream类属于org.embulk.spi.util包,在下文中一共展示了FileOutputOutputStream类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CommonsCompressArchiveProvider
import org.embulk.spi.util.FileOutputOutputStream; //导入依赖的package包/类
CommonsCompressArchiveProvider(PluginTask task, FileOutput fileOutput) {
this.format = ArchiveFormat.toArchiveFormat(task.getFormat());
this.underlyingFileOutput = fileOutput;
this.output = new FileOutputOutputStream(fileOutput, task.getBufferAllocator(), FileOutputOutputStream.CloseMode.FLUSH);
this.entryNamePrefix = task.getPrefix();
this.baseNum = baseNumSeq.incrementAndGet();
}
示例2: open
import org.embulk.spi.util.FileOutputOutputStream; //导入依赖的package包/类
@Override
public PageOutput open(TaskSource taskSource, final Schema schema, FileOutput output) {
final PluginTask task = taskSource.loadTask(PluginTask.class);
final Sheet sheet = newWorkbook(task);
final FileOutputOutputStream stream = new FileOutputOutputStream(output, task.getBufferAllocator(),
CloseMode.CLOSE);
stream.nextFile();
return new PageOutput() {
private final PageReader pageReader = new PageReader(schema);
@Override
public void add(Page page) {
pageReader.setPage(page);
PoiExcelColumnVisitor visitor = new PoiExcelColumnVisitor(task, schema, sheet, pageReader);
while (pageReader.nextRecord()) {
schema.visitColumns(visitor);
visitor.endRecord();
}
}
@Override
public void finish() {
Workbook book = sheet.getWorkbook();
try (FileOutputOutputStream os = stream) {
book.write(os);
os.finish();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Override
public void close() {
stream.close();
}
};
}
示例3: CommonsCompressCompressorProvider
import org.embulk.spi.util.FileOutputOutputStream; //导入依赖的package包/类
CommonsCompressCompressorProvider(PluginTask task, FileOutput fileOutput) {
this.format = CompressorFormat.toCompressorFormat(task.getFormat());
this.underlyingFileOutput = fileOutput;
this.output = new FileOutputOutputStream(fileOutput, task.getBufferAllocator(), FileOutputOutputStream.CloseMode.FLUSH);
}