public final boolean isExplicitSequenceLength() { return out.isExplicitSequenceLength(); }
public synchronized void rollback() throws IOException { filesetInfo.setOffsetFirstRootRecord(offsetFirstRootRecord()); filesetInfo.setOffsetLastRootRecord(offsetLastRootRecord()); cache.clear(); cachedParentRecord = null; cachedLastChildRecord = null; dirtyRecords.clear(); if (rollbackLen != -1) { recordSeqLen = rollbackLen - firstRecordPos; raf.seek(rollbackLen); if (!out.isExplicitSequenceLength() && !isEmpty()) { out.writeHeader(Tag.SequenceDelimitationItem, null, 0); } raf.setLength(raf.getFilePointer()); rollbackLen = -1; raf.seek(firstRecordPos - 14); raf.writeShort(FileSetInformation.NO_KNOWN_INCONSISTENCIES); filesetInfo.setFileSetConsistencyFlag( FileSetInformation.NO_KNOWN_INCONSISTENCIES); } }
public synchronized void commit() throws IOException { if (rollbackLen != -1 && !out.isExplicitSequenceLength()) { raf.seek(endPos()); out.writeHeader(Tag.SequenceDelimitationItem, null, 0); } if (offsetFirstRootRecord() != filesetInfo.getOffsetFirstRootRecord()) { offsetFirstRootRecord(filesetInfo.getOffsetFirstRootRecord()); } if (offsetLastRootRecord() != filesetInfo.getOffsetLastRootRecord()) { offsetLastRootRecord(filesetInfo.getOffsetLastRootRecord()); } filesetInfo.setFileSetConsistencyFlag( FileSetInformation.KNOWN_INCONSISTENCIES); recordSeqLen((int) recordSeqLen); raf.seek(firstRecordPos - dirInfoHeader.length); raf.write(dirInfoHeader, 0, dirInfoHeader.length); rollbackLen = -1; for (int i = 0, n = dirtyRecords.size(); i < n; i++) { writeDirRecordHeader(dirtyRecords.get(i)); } dirtyRecords.clear(); raf.seek(firstRecordPos - 14); raf.writeShort(FileSetInformation.NO_KNOWN_INCONSISTENCIES); filesetInfo.setFileSetConsistencyFlag( FileSetInformation.NO_KNOWN_INCONSISTENCIES); }