public static Byte[] GetBytes(this String value, Encoding encoding = null) { if (value == null) return null; if (value == String.Empty) return new Byte[0]; if (encoding == null) encoding = Encoding.UTF8; return encoding.GetBytes(value); }