本文整理汇总了Java中software.amazon.ion.system.IonBinaryWriterBuilder类的典型用法代码示例。如果您正苦于以下问题:Java IonBinaryWriterBuilder类的具体用法?Java IonBinaryWriterBuilder怎么用?Java IonBinaryWriterBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IonBinaryWriterBuilder类属于software.amazon.ion.system包,在下文中一共展示了IonBinaryWriterBuilder类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRoundtrip
import software.amazon.ion.system.IonBinaryWriterBuilder; //导入依赖的package包/类
@Test
public void testRoundtrip() throws IOException {
SdkIonGenerator generator = SdkIonGenerator.create(IonBinaryWriterBuilder.standard(), "foo");
data.generate(generator);
IonParser parser = new IonParser(SYSTEM.newReader(generator.getBytes()), false);
data.parse(parser);
assertNull(parser.nextToken()); // Asserts data was read fully.
assertFalse(parser.hasCurrentToken());
assertFalse(parser.isClosed());
parser.close();
assertTrue(parser.isClosed());
}
示例2: testRoundtrip
import software.amazon.ion.system.IonBinaryWriterBuilder; //导入依赖的package包/类
@Test
public void testRoundtrip() throws IOException
{
SdkIonGenerator generator = SdkIonGenerator.create(IonBinaryWriterBuilder.standard(), "foo");
data.generate(generator);
IonParser parser = new IonParser(SYSTEM.newReader(generator.getBytes()), false);
data.parse(parser);
assertNull(parser.nextToken()); // Asserts data was read fully.
assertFalse(parser.hasCurrentToken());
assertFalse(parser.isClosed());
parser.close();
assertTrue(parser.isClosed());
}
示例3: createWriter
import software.amazon.ion.system.IonBinaryWriterBuilder; //导入依赖的package包/类
public CachedWriter createWriter(boolean pretty) throws IOException {
CachedWriter writer = new CachedWriter();
writer.buffer = new ByteArrayOutputStream(512);
writer.writer = IonBinaryWriterBuilder.standard().build(writer.buffer);
return writer;
}
示例4: write
import software.amazon.ion.system.IonBinaryWriterBuilder; //导入依赖的package包/类
@Override
public byte[] write(String data) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
write(data, IonBinaryWriterBuilder.standard().build(out));
return out.toByteArray();
}