import { IRandomReader } from '../type' ; /**
 * Provides abstract Uint8Array access via the IRandomRead interface
 */ export class RandomUint8ArrayReader implements IRandomReader { public readonly fileSize : number ; constructor ( private readonly uint8Array ) { this . fileSize = uint8Array . length ; } param uint8Array param offset param length param position return public async randomRead ( uint8Array , offset , length , position ) { uint8Array . set ( this . uint8Array . subarray ( position , position + length ) , offset ) ; return length ; } }