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