public void Insert(uint entryId, TEntryValue value) { SerializeNewEntry(entryId, value, encryptor); uint valueInsertionIndex = GetValueInsertionIndex(value); uint entryPosition = GetEntryPosition(valueInsertionIndex); uint num = (uint)fileStream.Length; uint num2 = num + entrySize; if (entryPosition < num) { uint num3 = num - entryPosition; uint num4 = num2 - 32768; uint num5 = num - 32768; uint num6 = num3 / 32768u; uint num7 = num3 % 32768u; for (uint num8 = 0u; num8 < num6; num8++) { journalWriter.WriteCopyEntry(path, num5, 32768u, num4); num4 -= 32768; num5 -= 32768; } if (num7 != 0) { uint destPosition = entryPosition + entrySize; journalWriter.WriteCopyEntry(path, entryPosition, num7, destPosition); } } journalWriter.WriteWriteEntry(path, entryPosition, serializedBytes); Count++; }
private void WriteDocument(Page page, byte[] document) { journalWriter.WriteWriteEntry(documentsPath, page.DocumentOffset, document); documentsStream.Position += document.Length; }