encodeInt method
Implementation
void encodeInt(
int position, int value, int numOfBytes, Endian endianness, bool signed) {
switch (numOfBytes) {
case 4:
byteArray.setInt32(position, value, endianness);
break;
case 2:
byteArray.setInt16(position, value, endianness);
break;
case 1:
byteArray.setInt8(position, value);
break;
default:
throw Exception('Unsupported num of bytes: $numOfBytes');
}
}