private void PageChangeCommand(PersistPageChangeCommand command) { if (!reallyOpen) { PersistOpen(false); } // Buffer to Read the page content into byte[] buf; if (command.Count <= pageBuffer.Length) { // If length is smaller or equal to the size of a page then use the // local page buffer. buf = pageBuffer; } else { // Otherwise create a new buffer of the required size (this may happen // if the page size changes between sessions). buf = new byte[command.Count]; } // Read the change from the input stream var reader = new BinaryReader(command.Source, Encoding.Unicode); reader.Read(buf, 0, command.Count); // Write the change output to the underlying resource container long pos = command.PageNumber * 8192; //pageSize; Data.Write(pos + command.Offset, buf, 0, command.Count); }
private void PageChangeCommand(PersistPageChangeCommand command) { if (!reallyOpen) { PersistOpen(false); } // Buffer to Read the page content into byte[] buf; if (command.Count <= pageBuffer.Length) { // If length is smaller or equal to the size of a page then use the // local page buffer. buf = pageBuffer; } else { // Otherwise create a new buffer of the required size (this may happen // if the page size changes between sessions). buf = new byte[command.Count]; } // Read the change from the input stream var reader = new BinaryReader(command.Source, Encoding.Unicode); reader.Read(buf, 0, command.Count); // Write the change output to the underlying resource container long pos = command.PageNumber * 8192; //pageSize; Data.Write(pos + command.Offset, buf, 0, command.Count); }