public void AddDelete(Byte[] key, Byte[] value) { if (_deleteBuffer.AddRecord(key)) { if (_deleteBuffer.AddRecord(value)) { return; } _deleteBuffer.RemoveRecord(key.Length); } if (_deleteBuffer.Position == 0) { int bufferSize = _deleteBuffer.GetBufferSize(key.Length + value.Length); var buffer = new MultipleBuffer(bufferSize); buffer.AddRecord(key); buffer.AddRecord(value); _deleteData.Add(buffer.Close()); } else { CloseDeleteBuffer(); AddDelete(key, value); } }
public void AddWrite(Byte[] key, Byte[] value) { if (_writeBuffer.AddRecord(key)) { if (_writeBuffer.AddRecord(value)) { return; } _writeBuffer.RemoveRecord(key.Length); } if (_writeBuffer.Position == 0) { _writeData.Add(new Dto.BerkeleyDtoPut(key, value)); } else { CloseWriteBuffer(); AddWrite(key, value); } }