public void Write(ByteArrayInstance array) { using (BinaryWriter writer = new BinaryWriter(_data)) { writer.Write(array.GetBytes()); } }
static string HashByteArray(ByteArrayInstance array, [DefaultParameterValue(false)] bool sha = false) { HashAlgorithm hash; if (sha) hash = SHA1.Create(); else hash = MD5.Create(); using (hash) { return GetHash(hash, array.GetBytes()); } }
public void Write(ByteArrayInstance array) { _stream.Write(array.GetBytes(), 0, array.GetSize()); }
static string CreateStringFromByteArray(ByteArrayInstance array) { byte[] data = array.GetBytes(); string result = ""; for (var i = 0; i < data.Length; ++i) result += (char)data[i]; return result; }