本文整理汇总了Java中org.apache.avro.util.ByteBufferOutputStream类的典型用法代码示例。如果您正苦于以下问题:Java ByteBufferOutputStream类的具体用法?Java ByteBufferOutputStream怎么用?Java ByteBufferOutputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ByteBufferOutputStream类属于org.apache.avro.util包,在下文中一共展示了ByteBufferOutputStream类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processResult
import org.apache.avro.util.ByteBufferOutputStream; //导入依赖的package包/类
private void processResult(ByteBufferOutputStream bbo, BinaryEncoder out, RPCContext context,
Message m, List<ByteBuffer> payload, List<ByteBuffer> handshake, Object response,
Exception error) throws Exception {
out.writeBoolean(error != null);
if (error == null) {
writeResponse(m.getResponse(), response, out);
} else {
try {
writeError(m.getErrors(), error, out);
} catch (AvroRuntimeException e) {
throw error;
}
}
out.flush();
payload = bbo.getBufferList();
// Grab meta-data from plugins
RPCContextHelper.setResponsePayload(context, payload);
for (RPCPlugin plugin : rpcMetaPlugins) {
plugin.serverSendResponse(context);
}
META_WRITER.write(context.responseCallMeta(), out);
out.flush();
// Prepend handshake and append payload
bbo.prepend(handshake);
bbo.append(payload);
}