本文整理汇总了Java中org.embulk.spi.util.InputStreamFileInput类的典型用法代码示例。如果您正苦于以下问题:Java InputStreamFileInput类的具体用法?Java InputStreamFileInput怎么用?Java InputStreamFileInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputStreamFileInput类属于org.embulk.spi.util包,在下文中一共展示了InputStreamFileInput类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import org.embulk.spi.util.InputStreamFileInput; //导入依赖的package包/类
@Override
public FileInput open(TaskSource taskSource, FileInput fileInput) {
final PluginTask task = taskSource.loadTask(PluginTask.class);
final FileInputInputStream files = new FileInputInputStream(fileInput);
return new InputStreamFileInput(
task.getBufferAllocator(),
new InputStreamFileInput.Provider() {
public InputStream openNext() throws IOException {
if (!files.nextFile()) {
return null;
}
LOGGER.debug("generate LZ4FrameInputStream for {}", files.toString());
return new LZ4FrameInputStream(files);
}
public void close() throws IOException {
files.close();
}
}
);
}
示例2: fileInput
import org.embulk.spi.util.InputStreamFileInput; //导入依赖的package包/类
private FileInput fileInput(String... lines)
throws Exception
{
StringBuilder sb = new StringBuilder();
for (String line : lines) {
sb.append(line).append("\n");
}
ByteArrayInputStream in = new ByteArrayInputStream(sb.toString().getBytes(StandardCharsets.UTF_8));
return new InputStreamFileInput(runtime.getBufferAllocator(), provider(in));
}
示例3: fileInput
import org.embulk.spi.util.InputStreamFileInput; //导入依赖的package包/类
private FileInput fileInput(String... lines)
throws Exception
{
StringBuilder sb = new StringBuilder();
for (String line : lines) {
sb.append(line).append("\n");
}
ByteArrayInputStream in = new ByteArrayInputStream(sb.toString().getBytes());
return new InputStreamFileInput(runtime.getBufferAllocator(), provider(in));
}
示例4: fileInput
import org.embulk.spi.util.InputStreamFileInput; //导入依赖的package包/类
private FileInput fileInput(File file)
throws Exception
{
FileInputStream in = new FileInputStream(file);
return new InputStreamFileInput(runtime.getBufferAllocator(), provider(in));
}
示例5: provider
import org.embulk.spi.util.InputStreamFileInput; //导入依赖的package包/类
private InputStreamFileInput.IteratorProvider provider(InputStream... inputStreams)
throws IOException
{
return new InputStreamFileInput.IteratorProvider(
ImmutableList.copyOf(inputStreams));
}