All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bt.metainfo.IMetadataService Maven / Gradle / Ivy

There is a newer version: 1.10
Show newest version
package bt.metainfo;

import java.io.InputStream;
import java.net.URL;

/**
 * Service for creating torrents from bencoded sources.
 *
 * @since 1.0
 */
public interface IMetadataService {

    /**
     * Builds a torrent object from its binary representation located at {@code url}.
     *
     * @param url Binary bencoded representation of a torrent object
     * @return Torrent object.
     * @since 1.0
     */
    Torrent fromUrl(URL url);

    /**
     * Builds a torrent object from its binary representation.
     *
     * @param in Input stream, containing a bencoded representation.
     *           Caller should close the stream after the method has returned.
     * @return Torrent object.
     * @since 1.0
     */
    Torrent fromInputStream(InputStream in);

    /**
     * Builds a torrent object from its binary representation.
     *
     * @param bs binary bencoded representation of a torrent object
     * @return Torrent object.
     * @since 1.0
     */
    Torrent fromByteArray(byte[] bs);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy