admin管理员组

文章数量:1431372

实现Bencode借用github上开源项目 做了一些改造

https://github/dampcake/bencode

 新增方法encode(object o) 

实际上是利用反射将复杂对象转为map

    public static Map<String, Object> beanToMapComplate(Object bean) {
        if (bean == null) {
            return null;
        }
        Map<String, Object> map = new TreeMap<String, Object>();
        try {
            BeanInfo beanInfo = Introspector.getBeanInfo(bean.getClass());
            PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
            for (PropertyDescriptor property : propertyDescriptors) {
                String key = property.getName();
                if (!key.equals("class")) {
                    Method gette

本文标签: 爬虫磁力DHTjavaBencode