Add interim storage support for GroupV2Record.

This commit is contained in:
Greyson Parrelli
2020-03-18 12:37:28 -04:00
parent 707a2aca0a
commit 7a038ab09d
10 changed files with 311 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ import com.annimon.stream.Stream;
import com.google.common.collect.Sets;
import org.thoughtcrime.securesms.util.Conversions;
import org.whispersystems.libsignal.util.ByteUtil;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@@ -23,6 +24,12 @@ public final class TestHelpers {
return Conversions.intToByteArray(a);
}
public static byte[] byteArray(int a, int totalLength) {
byte[] out = new byte[totalLength - 4];
byte[] val = Conversions.intToByteArray(a);
return ByteUtil.combine(out, val);
}
public static List<byte[]> byteListOf(int... vals) {
List<byte[]> list = new ArrayList<>(vals.length);