Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created January 25, 2024 05:56
Extract 1st entry of RAR archive to Stream using Aspose.ZIP's RAR Extractor Plugin for .NET
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