Closed holicc closed 7 years ago
public static void main(String[] args) throws SocketException { DHT dht = new DHT(DHT.DHTtype.IPV4_DHT); DHTConfiguration configuration = new DHTConfiguration() { @Override public boolean isPersistingID() { return false; } @Override public Path getStoragePath() { return Paths.get(""); } @Override public int getListeningPort() { return 7892; } @Override public boolean noRouterBootstrap() { return false; } @Override public boolean allowMultiHoming() { return false; } }; dht.setScheduler(Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() * 2)); dht.start(configuration); dht.bootstrap(); List<DHT> dhts = new ArrayList<>(); dhts.add(dht); Supplier<InputStream> configSchema = () -> Launcher.class.getResourceAsStream("config.xsd"); Supplier<InputStream> configDefaults = () -> Launcher.class.getResourceAsStream("config-defaults.xml"); ConfigReader reader = new ConfigReader(Paths.get(".", "config.xml"), configDefaults, configSchema); reader.registerFsNotifications(new FilesystemNotifications()); TorrentDumper dumper = new TorrentDumper(); dumper.start(dhts, reader); }
TorrentDumper does not provide that customization. If you want to handle it differently you need to use TorrentFetcher instead which will provide its results as ByteBuffers.
TorrentDumper
TorrentFetcher
ByteBuffer