Created
January 25, 2024 05:56
Extract 1st entry of RAR archive to Stream using Aspose.ZIP's RAR Extractor Plugin for .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (RarArchive archive = new RarArchive("archive.rar")) | |
{ | |
using (var source = archive.Entries[0].Open()) | |
{ | |
byte[] buffer = new byte[4096]; | |
int bytesRead; | |
while ((bytesRead = source.Read(buffer, 0, buffer.Length)) > 0) | |
destination.Write(buffer, 0, bytesRead); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment