http://www.cnblogs.com/suding1188/archive/2012/03/15/2397609.html http://www.oschina.net/code/snippet_192817_6617