Я хочу преобразовать следующую функцию в дротик
public byte[] toByteArray(int requestCode, int length) {
ByteBuffer bb = ByteBuffer.allocate(length).order(ByteOrder.LITTLE_ENDIAN);
bb.put((byte) requestCode);
bb.putShort((short) length);
byte[] name = "TEST1".getBytes();
bb.put(name);
bb.put(new byte[30 - name.length]);
bb.put(new byte[50]);
var position = bb.position();
return bb.array();
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... -into-dart