private void read() { data.reset(); int type = data.readByte(); data.readShortInt(); this.parentPageId = data.readInt(); onlyPosition = (type & Page.FLAG_LAST) == 0; int indexId = data.readVarInt(); if (indexId != index.getId()) { throw DbException.get(ErrorCode.FILE_CORRUPTED_1, "page:" + getPos() + " expected index:" + index.getId() + "got:" + indexId); } rowCount = rowCountStored = data.readInt(); entryCount = data.readShortInt(); childPageIds = new int[entryCount + 1]; childPageIds[entryCount] = data.readInt(); rows = entryCount == 0 ? SearchRow.EMPTY_ARRAY : new SearchRow[entryCount]; offsets = Utils.newIntArray(entryCount); for (int i = 0; i < entryCount; i++) { childPageIds[i] = data.readInt(); offsets[i] = data.readShortInt(); } check(); start = data.length(); written = true; }
private void read() { data.reset(); int type = data.readByte(); data.readShortInt(); this.parentPageId = data.readInt(); onlyPosition = (type & Page.FLAG_LAST) == 0; int indexId = data.readVarInt(); if (indexId != index.getId()) { throw DbException.get(ErrorCode.FILE_CORRUPTED_1, "page:" + getPos() + " expected index:" + index.getId() + "got:" + indexId); } rowCount = rowCountStored = data.readInt(); entryCount = data.readShortInt(); childPageIds = new int[entryCount + 1]; childPageIds[entryCount] = data.readInt(); rows = entryCount == 0 ? SearchRow.EMPTY_ARRAY : new SearchRow[entryCount]; offsets = Utils.newIntArray(entryCount); for (int i = 0; i < entryCount; i++) { childPageIds[i] = data.readInt(); offsets[i] = data.readShortInt(); } check(); start = data.length(); written = true; }
private void read() { data.reset(); int type = data.readByte(); data.readShortInt(); this.parentPageId = data.readInt(); onlyPosition = (type & Page.FLAG_LAST) == 0; int indexId = data.readVarInt(); if (indexId != index.getId()) { throw DbException.get(ErrorCode.FILE_CORRUPTED_1, "page:" + getPos() + " expected index:" + index.getId() + "got:" + indexId); } rowCount = rowCountStored = data.readInt(); entryCount = data.readShortInt(); childPageIds = new int[entryCount + 1]; childPageIds[entryCount] = data.readInt(); rows = entryCount == 0 ? SearchRow.EMPTY_ARRAY : new SearchRow[entryCount]; offsets = Utils.newIntArray(entryCount); for (int i = 0; i < entryCount; i++) { childPageIds[i] = data.readInt(); offsets[i] = data.readShortInt(); } check(); start = data.length(); written = true; }