constreader=fs.createReadStream(absolutePath).pipe(encoding.decodeStream(fileEncoding));// decode takes care of stripping any BOMs from the file content
constreader=fs.createReadStream(absolutePath).pipe(encoding.decodeStream(fileEncoding));// decode takes care of stripping any BOMs from the file content
reader.on('data',(buf)=>{
letcontent:files.IStreamContent=<any>model;
content.value=reader;
content.encoding=fileEncoding;// make sure to store the encoding in the model to restore it later when writing