net.sf.torrentsniffer.bencoding
Interface Bencoding

All Known Implementing Classes:
BencodingImpl

public interface Bencoding

Implements the bencoding specification. See http://wiki.theory.org/index.php/BitTorrentSpecification for information about bencoding.

Author:
Larry Williams

Method Summary
 Dictionary decode(java.io.InputStream input)
          Decodes the bencoded data in a stream.
 Dictionary decode(java.lang.String file)
          Decodes the bencoded data in a torrent file.
 Dictionary decode(java.net.URL url)
          Decodes the bencoded data in a URL.
 void encode(java.io.OutputStream out, java.lang.Object object)
          Encodes a graph of objects.
 boolean match(Dictionary bencoded1, Dictionary bencoded2)
          Checks if two bencoded Dictionaries are the same.
 

Method Detail

decode

public Dictionary decode(java.lang.String file)
                  throws java.io.FileNotFoundException
Decodes the bencoded data in a torrent file.

Parameters:
file -
Returns:
Throws:
java.io.FileNotFoundException

decode

public Dictionary decode(java.io.InputStream input)
Decodes the bencoded data in a stream.

Parameters:
input -
Returns:

decode

public Dictionary decode(java.net.URL url)
Decodes the bencoded data in a URL.

Parameters:
url -
Returns:

encode

public void encode(java.io.OutputStream out,
                   java.lang.Object object)
Encodes a graph of objects.

Parameters:
object -
out -
Returns:

match

public boolean match(Dictionary bencoded1,
                     Dictionary bencoded2)
Checks if two bencoded Dictionaries are the same. Assuming a bencoded file always starts with a Dictionary.

Returns:


Copyright © 2004 Larry Williams. All Rights Reserved.