Adds a simple appendByte function with bounds checking on the input.