/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter UniSharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const Utils = require("./../../../unisharp/Utils");
const Stream = require("./../../../unisharp/Stream");
const FileStream = require("./../../../unisharp/FileStream");

const CompoundFileStream = require("./CompoundFileStream");
const ReaderUtils = require("./ReaderUtils");

class MiniFATStream extends CompoundFileStream {
    
    constructor(_storage) {
        super(_storage, _storage.system.getMiniSectorSize());
    }
    
    getPageData(pageIndex) {
        let page = new Uint8Array(this.pageSize);
        let sector = this.system.getMiniStreamNextSector(this.storage.entry.startingSectorLocation, pageIndex);
        return ReaderUtils.readFragment(this.system.baseStream, this.system.getMiniSectorOffset(sector), this.pageSize);
    }
}


module.exports = MiniFATStream