public static void WriteVarInt(this MemoryStream ms, UInt64 data) { byte[] bytes = data.VarIntToBytes(); ms.Write(bytes, 0, bytes.Length); }