No public description
PiperOrigin-RevId: 583417701
This commit is contained in:
parent
e7c7638833
commit
9456c64830
|
@ -128,6 +128,16 @@ public final class PacketGetter {
|
||||||
return ProtoUtil.unpack(result, defaultInstance);
|
return ProtoUtil.unpack(result, defaultInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T extends MessageLite> T getProto(final Packet packet, Parser<T> messageParser) {
|
||||||
|
SerializedMessage result = new SerializedMessage();
|
||||||
|
nativeGetProto(packet.getNativeHandle(), result);
|
||||||
|
try {
|
||||||
|
return messageParser.parseFrom(result.value);
|
||||||
|
} catch (InvalidProtocolBufferException e) {
|
||||||
|
throw new IllegalArgumentException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated {@link #getProto(Packet, MessageLite)} is safer to use in obfuscated builds.
|
* @deprecated {@link #getProto(Packet, MessageLite)} is safer to use in obfuscated builds.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user