public static byte[] ToBuffer(char[] hexBuffer, int offset, int count)
{
if (hexBuffer == null) throw new ArgumentNullException("hexBuffer");
if (offset < 0) throw new ArgumentOutOfRangeException("offset");
if (count < 0) throw new ArgumentOutOfRangeException("count");
if (offset + count > hexBuffer.Length) throw new ArgumentOutOfRangeException("count");
var buffer = new byte[(hexBuffer.Length + 1) / 2];
CopyHexBufferToBuffer(hexBuffer, offset, count, buffer, 0);
return buffer;
}
public static byte[] ToBuffer(string hexString)