com.google.protobuf.InvalidProtocolBufferException

时间:2018-10-29 13:00:28

标签: java json prototype protocol-buffers

试图从字节中解析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);

Exception screenshot

0 个答案:

没有答案