forked from I2P_Developers/i2p.i2p
i2psnark: more type arguments
This commit is contained in:
@ -142,6 +142,7 @@ public class BEValue
|
||||
* succeeds when the BEValue is actually a List, otherwise it will
|
||||
* throw a InvalidBEncodingException.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<BEValue> getList() throws InvalidBEncodingException
|
||||
{
|
||||
try
|
||||
@ -159,6 +160,7 @@ public class BEValue
|
||||
* values. This operation only succeeds when the BEValue is actually
|
||||
* a Map, otherwise it will throw a InvalidBEncodingException.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, BEValue> getMap() throws InvalidBEncodingException
|
||||
{
|
||||
try
|
||||
|
@ -59,9 +59,9 @@ public class BEncoder
|
||||
else if (o instanceof Number)
|
||||
bencode((Number)o, out);
|
||||
else if (o instanceof List)
|
||||
bencode((List)o, out);
|
||||
bencode((List<?>)o, out);
|
||||
else if (o instanceof Map)
|
||||
bencode((Map<String, Object>)o, out);
|
||||
bencode((Map<?, ?>)o, out);
|
||||
else if (o instanceof BEValue)
|
||||
bencode(((BEValue)o).getValue(), out);
|
||||
else
|
||||
@ -110,7 +110,7 @@ public class BEncoder
|
||||
out.write('e');
|
||||
}
|
||||
|
||||
public static byte[] bencode(List l)
|
||||
public static byte[] bencode(List<?> l)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -124,10 +124,10 @@ public class BEncoder
|
||||
}
|
||||
}
|
||||
|
||||
public static void bencode(List l, OutputStream out) throws IOException
|
||||
public static void bencode(List<?> l, OutputStream out) throws IOException
|
||||
{
|
||||
out.write('l');
|
||||
Iterator it = l.iterator();
|
||||
Iterator<?> it = l.iterator();
|
||||
while (it.hasNext())
|
||||
bencode(it.next(), out);
|
||||
out.write('e');
|
||||
|
Reference in New Issue
Block a user