Encode an immediate value as a sequence of bytes.