I saw it today from Http://www.cnblogs.com/NanaLich/archive/2012/05/24/2516860.html, and recorded it.
Mainly Xmlserializationreader and xmlserializationwriter two abstract classes contain a lot of protected methods, of which the more useful is byte[] and hexstring conversion, Analysis of source discovery is implemented by two internal classes: Binhexencoder and Binhexdecoder, see the name is very clear, specifically to deal with the conversion of byte[] and hex, as to why only the internal class, it is unclear why.
Class Dummywriter:xmlserializationwriter { protected override void Initcallbacks () {} public static String Bytestohex (byte[] bin) { return frombytearrayhex (BIN); } } Class Dummyreader:xmlserializationreader { protected override void Initcallbacks () {} protected override void Initids () {} public static byte[] Hextobytes (string hex) { return Tobytearrayhex (hex); c15/>} }
Alternative notation for converting between C # byte arrays and hexadecimal strings