314 throw new Exception(
"Assert failed: offset is not 64k aligned.");
318 throw new Exception(
"Assert failed: length is greater than 64K.");
328 throw new IOException(
"Object id is out of range.");
331 var status = block.ReadInt4();
333 throw new InvalidOperationException(
"Assertion failed: record is deleted!");
336 maxSize = block.ReadInt8();
337 currentSize = block.ReadInt8();
338 objPos = block.ReadInt8();
344 var type = area.ReadInt4();
345 var size = area.ReadInt8();
348 if (objOffset < 0 || objOffset + length > size) {
349 throw new IOException(
"Object invalid write. offset = " + objOffset +
", length = " + length +
", size = " + size);
353 long pageNumber = (objOffset / (
PageSize * 1024));
354 area.Position = (int)((pageNumber * 8) + 32);
355 long pagePos = area.ReadInt8();
360 throw new Exception(
"Assert failed: page position is not -1");
369 var deflateStream =
new DeflateStream(
new MemoryStream(buffer, off, length), CompressionMode.Compress,
false);
370 toWrite =
new byte[
PageSize * 1024];
371 writeLength = deflateStream.Read(toWrite, 0, toWrite.Length);
373 throw new NotSupportedException(
"Compression not supported in PCL.");
378 writeLength = length;
386 pagePos = pageArea.
Id;
387 pageArea.WriteInt4(1);
388 pageArea.WriteInt4(writeLength);
389 pageArea.Write(toWrite, 0, writeLength);
394 area.Position = (int)((pageNumber * 8) + 24);
395 area.WriteInt8(currentSize + writeLength);
396 area.WriteInt8(pagePos);
IArea CreateArea(long size)
Allocates a block of memory in the store of the specified size and returns an IArea object that can b...
void Lock()
This method is called before the start of a sequence of Write commands between consistant states of s...
void Unlock()
This method is called after the end of a sequence of Write commands between consistant states of some...
readonly FixedRecordList fixedList
IArea GetArea(long id, bool readOnly)
Returns an object that allows for the contents of an area (represented by the id parameter) to be Re...
long Id
Returns the unique identifier that represents this area.
IArea GetRecord(long recordNumber)