@Override
    protected int runTest(StdConverter.Operation oper) throws Exception
    {
        if (oper == null) {
            throw new RuntimeException("Internal exception: no operation passed");
        }

        final boolean doRead = (oper != StdConverter.Operation.WRITE);
        final boolean doWrite = (oper != StdConverter.Operation.READ);

        // read or read-write?
        if (doRead) {
            int result = 0;
            final ByteArrayOutputStream bos = new ByteArrayOutputStream(16000);
            for (byte[] input : _readableData) {
                DbData dd = (DbData) _converter.readData(new ByteArrayInputStream(input));
                if (dd == null) {
                    throw new IllegalStateException("Deserialized doc to null");
                }
                result += dd.size();
                _totalLength += input.length;
                if (doWrite) {
                    result += _converter.writeData(bos, dd);
                    _totalLength += bos.size();
                    bos.reset();
                }
            }
            return result;
        }

        // write-only:
        final ByteArrayOutputStream bos = new ByteArrayOutputStream(16000);
        int result = 0;
        for (DbData input : _writableData) {
            result += _converter.writeData(bos, input);
            _totalLength += bos.size();
            bos.reset();
        }
        return result;
    }