Closed samyuu closed 4 years ago
I think I know. Whenever a new entry gets added to the view, the archive's underlying stream seeks out of previous entry's scope. Since seeking in compressed streams isn't supported, StreamView cannot correct underlying stream's position, causing it to read data out of its bounds.
By this logic, the latest entry added to the view should be extracted correctly, because the position of the archive's underlying stream will be where the latest entry starts.
However, this is just an assumption. At the moment, I cannot check if this is actually the case.
Fixed as of ee5cb85
After single file exporting one file inside a compressed farc, successive single file exports are created but not successfully written to resulting in empty output files.
https://github.com/blueskythlikesclouds/MikuMikuLibrary/blob/98d6f18bf659f25368c6a677586cd040c71a83c5/MikuMikuModel/Nodes/IO/StreamNode.cs#L21-L24 does not copy any data. For both the first file being exported and successive ones, Data.CanSeek evaluates to false but the stream's position is already set to 0 so that is not the issue. Trying out
also leaves the buffer empty despite the Data's EntryStream.CanRead property returning true. I am unsure as to why this happens.