本文整理汇总了Java中software.amazon.ion.IonWriter类的典型用法代码示例。如果您正苦于以下问题:Java IonWriter类的具体用法?Java IonWriter怎么用?Java IonWriter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IonWriter类属于software.amazon.ion包,在下文中一共展示了IonWriter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createResponse
import software.amazon.ion.IonWriter; //导入依赖的package包/类
private static HttpResponse createResponse(IonStruct payload) throws Exception {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
IonWriter writer = system.newBinaryWriter(bytes);
payload.writeTo(writer);
writer.close();
HttpResponse error = new HttpResponse(ValidSdkObjects.sdkHttpFullRequest().build());
error.setContent(new ByteArrayInputStream(bytes.toByteArray()));
return error;
}
示例2: createResponse
import software.amazon.ion.IonWriter; //导入依赖的package包/类
private static HttpResponse createResponse(IonStruct payload) throws Exception {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
IonWriter writer = system.newBinaryWriter(bytes);
payload.writeTo(writer);
writer.close();
HttpResponse error = new HttpResponse(new DefaultRequest(NO_SERVICE_NAME), NO_HTTP_REQUEST);
error.setContent(new ByteArrayInputStream(bytes.toByteArray()));
return error;
}
示例3: SdkIonGenerator
import software.amazon.ion.IonWriter; //导入依赖的package包/类
private SdkIonGenerator(IonWriter writer, String contentType) {
this.writer = writer;
this.contentType = contentType;
}
示例4: create
import software.amazon.ion.IonWriter; //导入依赖的package包/类
public static SdkIonGenerator create(IonWriterBuilder builder, String contentType) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
IonWriter writer = builder.build(bytes);
return new ByteArraySdkIonGenerator(bytes, writer, contentType);
}
示例5: ByteArraySdkIonGenerator
import software.amazon.ion.IonWriter; //导入依赖的package包/类
ByteArraySdkIonGenerator(ByteArrayOutputStream bytes, IonWriter writer, String contentType) {
super(writer, contentType);
this.bytes = bytes;
}
示例6: write
import software.amazon.ion.IonWriter; //导入依赖的package包/类
public static void write(String data, IonWriter writer) throws IOException {
IonReader reader = SYSTEM.newReader(data);
writer.writeValues(reader);
writer.close();
}
示例7: ByteArraySdkIonGenerator
import software.amazon.ion.IonWriter; //导入依赖的package包/类
public ByteArraySdkIonGenerator(ByteArrayOutputStream bytes, IonWriter writer, String contentType) {
super(writer, contentType);
this.bytes = bytes;
}