java/core/src/main/java/se/lth/cs/docria/io/MsgpackDocumentStreamReader.java
/**
     * Consumes all documents without deserialization for a fast exact document count.
     * @return number of documents found.
     */
Consumes all documents without deserialization for a fast exact document count.
@return number of documents found.
Consumes all documents without deserialization for a fast exact document count . @return number of documents found .
public long count() {
        long k = 0;
        if(block == null) {
            block = readNextBlock();
            if (block == null)
                return k;
        }
        while(true) {
            try {
                block.skipValue();
                k++;
                if(!block.hasNext()) {
                    block = readNextBlock();
                    if (block == null)
                        return k;
                }
            } catch (IOException e) {
                throw new IOError(e);
            }
        }
    }
public long count ( ) { long k = 0 ; if ( block == null ) { block = readNextBlock ( ) ; if ( block == null ) return k ; } while ( true ) { try { block . skipValue ( ) ; k ++ ; if ( ! block . hasNext ( ) ) { block = readNextBlock ( ) ; if ( block == null ) return k ; } } catch ( IOException e ) { throw new IOError ( e ) ; } } }
Consumes all documents without deserialization for a fast exact document count.
Consumes all documents without deserialization for a fast exact document count .