Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import System;
external Uint8Array;
class ByteArray
{
var stack;
ByteArray(int size) {
this.stack = new Uint8Array(size);
}
byte get(int index) {
return stack[index];
}
byte set(int index, byte value) {
return stack[index] = value;
}
property int length() {
return stack.length;
}
}
ByteArray b = new ByteArray(1);
b.set(0, 255);
Console.log(b.get(0));
Console.log(b.length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.