Looks good to me.  Do you want to introduce a constant to replace the repeated 256 values on lines 254 and 301?