Search in sources :

Example 1 with BundleReader

use of de.lmu.ifi.dbs.elki.datasource.bundle.BundleReader in project elki by elki-project.

the class BundleDatabaseConnection method loadData.

@Override
public MultipleObjectsBundle loadData() {
    try {
        FileInputStream fis = new FileInputStream(infile);
        FileChannel channel = fis.getChannel();
        MultipleObjectsBundle bundle = invokeStreamFilters(new BundleReader(channel)).asMultipleObjectsBundle();
        channel.close();
        fis.close();
        return bundle;
    } catch (IOException e) {
        throw new AbortException("IO error loading bundle", e);
    }
}
Also used : FileChannel(java.nio.channels.FileChannel) MultipleObjectsBundle(de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream) BundleReader(de.lmu.ifi.dbs.elki.datasource.bundle.BundleReader) AbortException(de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException)

Aggregations

BundleReader (de.lmu.ifi.dbs.elki.datasource.bundle.BundleReader)1 MultipleObjectsBundle (de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle)1 AbortException (de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 FileChannel (java.nio.channels.FileChannel)1