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