/**
* Reads a list of protos, using the provided parser, from the provided input stream.
* @throws IOException if the proto list could not be parsed.
*/
public static <T extends MessageLite> List<T> readMessageList(
InputStream stream,
Parser<T> parser)
throws IOException {
DataInputStream dis = new DataInputStream(stream);
int messageCount = dis.readInt();
ArrayList<T> messages = new ArrayList<>(messageCount);
for (int i = 0; i < messageCount; i++) {
messages.add(parser.parseDelimitedFrom(stream));
}
return messages;
}
ProtoListUtil.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:OpenYOLO-Android
作者:
评论列表
文章目录