Package org.tmatesoft.sqljet.core.internal

Examples of org.tmatesoft.sqljet.core.internal.ISqlJetMemoryPointer.remaining()


     * @return
     * @throws SqlJetIOException
     */
    private long read32bitsUnsigned(final ISqlJetFile fd, final long offset) throws SqlJetIOException {
        ISqlJetMemoryPointer ac = SqlJetUtility.allocatePtr(4);
        fd.read(ac, ac.remaining(), offset);
        return SqlJetUtility.get4byteUnsigned(ac);
    }

    /**
     * The journal file must be open when this is called. A journal header file
View Full Code Here


        if (journalOff + JOURNAL_HDR_SZ() > journalSize) {
            throw new SqlJetException(SqlJetErrorCode.DONE);
        }
        jrnlOff = journalOff;

        jfd.read(aMagic, aMagic.remaining(), jrnlOff);
        jrnlOff += aMagic.remaining();

        if (0 != SqlJetUtility.memcmp(aMagic, aJournalMagic, aMagic.remaining())) {
            throw new SqlJetException(SqlJetErrorCode.DONE);
        }
View Full Code Here

            throw new SqlJetException(SqlJetErrorCode.DONE);
        }
        jrnlOff = journalOff;

        jfd.read(aMagic, aMagic.remaining(), jrnlOff);
        jrnlOff += aMagic.remaining();

        if (0 != SqlJetUtility.memcmp(aMagic, aJournalMagic, aMagic.remaining())) {
            throw new SqlJetException(SqlJetErrorCode.DONE);
        }
View Full Code Here

        jrnlOff = journalOff;

        jfd.read(aMagic, aMagic.remaining(), jrnlOff);
        jrnlOff += aMagic.remaining();

        if (0 != SqlJetUtility.memcmp(aMagic, aJournalMagic, aMagic.remaining())) {
            throw new SqlJetException(SqlJetErrorCode.DONE);
        }

        int pNRec = read32bits(jfd, jrnlOff);
        cksumInit = read32bitsUnsigned(jfd, jrnlOff + 4);
View Full Code Here

     *
     * @throws SqlJetIOException
     */
    static void write32bits(ISqlJetFile fd, long offset, int val) throws SqlJetIOException {
        final ISqlJetMemoryPointer b = SqlJetUtility.put4byte(val);
        fd.write(b, b.remaining(), offset);
    }

    static void write32bitsUnsigned(ISqlJetFile fd, long offset, long val) throws SqlJetIOException {
        final ISqlJetMemoryPointer b = SqlJetUtility.put4byteUnsigned(val);
        fd.write(b, b.remaining(), offset);
View Full Code Here

        fd.write(b, b.remaining(), offset);
    }

    static void write32bitsUnsigned(ISqlJetFile fd, long offset, long val) throws SqlJetIOException {
        final ISqlJetMemoryPointer b = SqlJetUtility.put4byteUnsigned(val);
        fd.write(b, b.remaining(), offset);
    }

    /*
     * (non-Javadoc)
     *
 
View Full Code Here

        setMaster = true;

        final ISqlJetMemoryPointer zMaster = SqlJetUtility.wrapPtr(master.getBytes());

        len = zMaster.remaining();
        for (i = 0; i < len; i++) {
            cksum += SqlJetUtility.getUnsignedByte(zMaster, i);
        }

        /*
 
View Full Code Here

            row[primaryKeyColumnNumber] = null;
            pData = SqlJetBtreeRecord.getRecord(encoding, row).getRawRecord();
            row[primaryKeyColumnNumber] = rowId;
        }
        if (doActionWithIndexes(Action.INSERT, onConflict, rowId, row)) {
            getCursor().insert(null, rowId, pData, pData.remaining(), 0, true);
            goToRow(rowId);
        }
    }

    /*
 
View Full Code Here

        if (doActionWithIndexes(Action.UPDATE, onConflict, newRowId, rowCompleted)) {
            final boolean changeRowId = newRowId != currentRowId;
            if (changeRowId) {
                getCursor().delete();
            }
            getCursor().insert(null, newRowId, pData, pData.remaining(), 0, changeRowId);
            goToRow(newRowId);
        }

    }
View Full Code Here

        final SqlJetEncoding encoding = btree.getDb().getOptions().getEncoding();
        final ISqlJetMemoryPointer firstRec = SqlJetBtreeRecord.getRecord(encoding, firstKey).getRawRecord();
        final ISqlJetMemoryPointer lastRec = SqlJetBtreeRecord.getRecord(encoding, lastKey).getRawRecord();
        final SqlJetUnpackedRecord unpacked = getKeyInfo().recordUnpack(firstRec.remaining(), firstRec);
        unpacked.getFlags().add(SqlJetUnpackedRecordFlags.PREFIX_MATCH);
        return unpacked.recordCompare(lastRec.remaining(), lastRec);
    }

    /*
     * (non-Javadoc)
     *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.