Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 151', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | - - Quantum 444444443333333333222222222211111111110000000000 Offset 765432109876543210987654321098765432109876543210 - - 666666666666666666666666666666666666666666666666 999111111111111111111111111111111111111111111111 Address 999000000000011111111112222222222333333333344444 789012345678901234567890123456789012345678901234 - Of course all of the item index entries from the one we are inserting to the last one now have the wrong offset we have to add the size of the new item to these offsets to account for the move we just did which we do by calling Adj ustOffset. We re almost done with this insertion. All we have left is to calculate the actual position of the new item in the quantum as the quantum buffer s address the size of a quantum - the offset of this item 4096 2048-28 or 6116 and store the result in DataTo. Then we can call BlockMove to copy the new item s data to that position and finish up by setting the relative item number which is the return value from this function to ItemFound 1 and returning it. The final quantum contents look like Figure insert3. Item index and data after item insertion Figure insert3 - Item Offset Type Index ------------------------- 1 5 -- VARSTRING 4 Item 2 17 - VARSTRING 0 Index 3 -19 VARSTRING 3 4 28- VARSTRING 6 5 -40 VARSTRING 1 6 -47 VARSTRING 2 --- ------------------- - ----------------- ------------ ---- ---------- - ------- ----- -- ---- ------- ------ - -------- -- Quantum BaldwinP.O.Box 0335ChrysalisNYSteve Heller11510 Data ---------------------------------- - - Quantum 444444443333333333222222222211111111110000000000 Offset 765432109876543210987654321098765432109876543210 - - 666666666666666666666666666666666666666666666666 999111111111111111111111111111111111111111111111 Address 999000000000011111111112222222222333333333344444 789012345678901234567890123456789012345678901234 - The above scenario handles the case of reusing an item index slot. The code following the comment that says must make a new item deals with .