Package org.klomp.snark.bencode
Class BEncoder
- java.lang.Object
-
- org.klomp.snark.bencode.BEncoder
-
public class BEncoder extends Object
-
-
Constructor Summary
Constructors Constructor Description BEncoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
bencode(byte[] bs, OutputStream out)
static void
bencode(Number n, OutputStream out)
static void
bencode(Object o, OutputStream out)
static void
bencode(String s, OutputStream out)
static void
bencode(List<?> l, OutputStream out)
static byte[]
bencode(Map<?,?> m)
Keys must be Strings or (supported as of 0.9.31) byte[]s A mix in the same Map is not supported.static void
bencode(Map<?,?> m, OutputStream out)
Keys must be Strings or (supported as of 0.9.31) byte[]s A mix in the same Map is not supported.
-
-
-
Method Detail
-
bencode
public static void bencode(Object o, OutputStream out) throws IOException, IllegalArgumentException
- Throws:
IOException
IllegalArgumentException
-
bencode
public static void bencode(String s, OutputStream out) throws IOException
- Throws:
IOException
-
bencode
public static void bencode(Number n, OutputStream out) throws IOException
- Throws:
IOException
-
bencode
public static void bencode(List<?> l, OutputStream out) throws IOException
- Throws:
IOException
-
bencode
public static void bencode(byte[] bs, OutputStream out) throws IOException
- Throws:
IOException
-
bencode
public static byte[] bencode(Map<?,?> m)
Keys must be Strings or (supported as of 0.9.31) byte[]s A mix in the same Map is not supported.- Throws:
IllegalArgumentException
- if keys are not all Strings or all byte[]s
-
bencode
public static void bencode(Map<?,?> m, OutputStream out) throws IOException, IllegalArgumentException
Keys must be Strings or (supported as of 0.9.31) byte[]s A mix in the same Map is not supported.- Throws:
IllegalArgumentException
- if keys are not all Strings or all byte[]sIOException
-
-