java: Add support for u32 arrays
java: Add support for u32 arrays
The generated Java code was missing some code to allow for u32 arrays,
which is needed for the upcoming signature message.
@@ -189,6 +189,16 @@ public class SBPMessage {
return ret;
}
+ public long[] getArrayofU32() {
+ return getArrayofU32(buf.remaining() / 4);
+ }
+
+ public long[] getArrayofU32(int n) {
+ long[] ret = new long[n];
+ for (int i = 0; i < n; i++) ret[i] = getU32();
+ return ret;
+ }
+
public float[] getArrayofFloat() {
return getArrayofFloat(buf.remaining() / Float.BYTES);
}
@@ -341,6 +351,15 @@ public class SBPMessage {
putArrayofU16(data);
}
+ public void putArrayofU32(long[] data) {
+ for (long x : data) buf.putLong(x);
+ }
+
+ public void putArrayofU32(long[] data, int n) {
+ assert (n == data.length);
+ putArrayofU32(data);
+ }
+
public void putArrayofDouble(double[] data) {
for (double x : data) putDouble(x);
}
