这篇文章写的详细,可参考
http://shiyanjun.cn/archives/1075.html
转:https://www.cnblogs.com/JsonShare/p/5265368.html