java - com.google.protobuf.InvalidProtocolBufferException
问题描述
试图从字节解析bidrequest,但得到如下异常,已经搜索了很长时间但无法找到解决方案。如果有人知道,请帮助...
//Bidrequest json string fetched from httpRequest
String obj = request.getReader().lines().collect(Collectors.joining());
ExtensionRegistry reg = ExtensionRegistry.newInstance();
AdxExt.registerAllExtensions(reg);
InputStream input = new ByteArrayInputStream(obj.getBytes(),0,obj.getBytes().length);
BidRequest openRTBRequest =BidRequest.parseFrom(input,reg);
解决方案
推荐阅读
- php - 如何使用这种结构将 2 个字段保存在 2 个不同的表中?- 拉拉维尔
- kubernetes - 错误:Kubernetes 中版本“keda.k8s.io/v1alpha1”中的“ScaledObject”类型没有匹配项
- sql - 将多个sql结果合并到一张表中?
- javascript - 使用新的 Google 身份服务 SDK 如何获取刷新令牌
- arduino - 使用 Accel 移动 Redrex 步进电机
- appium - 我无法在我的 macbook M1 上运行 uiautomatorviewer
- python - 在卷积神经网络中,如何在 Keras 函数模型中使用 Maxout?
- javascript - Javascript React无法读取null的属性
- azure - 使用图形 api 创建在线会议时出错
- node.js - 在 Jenkins 中:如何运行 NPM install 、 npm run 和 Npm run 代理