下面CSDN的博客已经描述的很好了。不写了
references:
http://blog.csdn.net/ei__nino/article/details/7297791
http://blog.csdn.net/liuysheng/article/details/6744976