参照连接:http://www.cnblogs.com/mmll/archive/2012/03/11/2389979.html
http://www.oschina.net/code/snippet_16_2541