首页 > 解决方案 > 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);

异常截图

标签: javajsonprototypeprotocol-buffers

解决方案


推荐阅读