org.gudy.azureus2.core3.util
Class BEncoder
java.lang.Object
org.gudy.azureus2.core3.util.BEncoder
public class BEncoder
- extends Object
A set of utility methods to encode a Map into a bencoded array of byte.
integer are represented as Long, String as byte[], dictionnaries as Map, and list as List.
- Author:
- TdC_VgA
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
encode
public static byte[] encode(Map object)
throws IOException
- Throws:
IOException
encode
public static byte[] encode(Map object,
boolean url_encode)
throws IOException
- Throws:
IOException
isEncodable
public static boolean isEncodable(Object toCheck)
objectsAreIdentical
public static boolean objectsAreIdentical(Object o1,
Object o2)
listsAreIdentical
public static boolean listsAreIdentical(List list1,
List list2)
mapsAreIdentical
public static boolean mapsAreIdentical(Map map1,
Map map2)
cloneMap
public static Map cloneMap(Map map)
cloneList
public static List cloneList(List list)
clone
public static Object clone(Object obj)
encodeToXML
public static StringBuffer encodeToXML(Map map,
boolean simple)
encodeToJSONArray
public static JSONArray encodeToJSONArray(List b_list)
encodeToJSONObject
public static JSONObject encodeToJSONObject(Map<Object,Object> b_map)
encodeToJSON
public static String encodeToJSON(Map b_map)
main
public static void main(String[] args)