本文整理匯總了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);
}