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