public void AddByteTimes(byte b, int times) { for(int i=0;i<times;i++) { ms.Write(BitConverter.GetBytes(b), 0, 1); } }