Convert a number to a byte array

Yes, certainly. It may require using a style which is similar to how the C code would be optimized.