We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa83c20 commit 879ffb7Copy full SHA for 879ffb7
src/main/java/com/annimon/ownlang/lib/ValueUtils.java
@@ -90,4 +90,13 @@ public static float getFloatNumber(Value value) {
90
if (value.type() == Types.NUMBER) return ((NumberValue) value).raw().floatValue();
91
return (float) value.asNumber();
92
}
93
+
94
+ public static byte[] toByteArray(ArrayValue array) {
95
+ final int size = array.size();
96
+ final byte[] result = new byte[size];
97
+ for (int i = 0; i < size; i++) {
98
+ result[i] = (byte) array.get(i).asInt();
99
+ }
100
+ return result;
101
102
0 commit comments