Package ch.akuhn.hapax.util

Examples of ch.akuhn.hapax.util.ResourceStream


    private int rows, columns;
    private Resource file;
   
    public OfflineMatrix(Resource file) {
        this.file = file;
        ResourceStream in = file.open();
        rows = in.nextInt();
        columns = in.nextInt();
        in.close();
    }
View Full Code Here


    public int used() {
        return rows * columns;
    }
    public static final OfflineMatrix from(Matrix matrix, Resource file) {
        ResourceStream out = file.writeStream();
        out.put(matrix.rowCount());
        out.put(matrix.columnCount());
        for (Vector row: matrix.rows())
            for (Entry each: row.entries())
                out.put(each.value);
        out.close();
        return new OfflineMatrix(file);
    }
View Full Code Here

TOP

Related Classes of ch.akuhn.hapax.util.ResourceStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.