question: write byte buffer to RAR file #551

Closed
opened 2026-01-29 22:13:38 +00:00 by claunia · 1 comment
Owner

Originally created by @ghost on GitHub (Dec 16, 2022).

Hi

I have a byte buffer filled of all bytes that represent the contents of a RAR file like this:

var buffer = new byte[length];

Those contents in the buffer are read from a custom big file which has RAR files inside it (a sort of custom container).

Is there a way I can write this buffer to a RAR file using sharpcompress or how should I do this?

If I do this (without using any library):

File.WriteAllBytes(filename, buffer);

Then WinRAR says the file has "unknown format or is damaged".
But the buffer is successfully written and the file has exactly the amount of bytes from the buffer.

Thanks

Originally created by @ghost on GitHub (Dec 16, 2022). Hi I have a byte buffer filled of all bytes that represent the contents of a RAR file like this: `var buffer = new byte[length];` Those contents in the buffer are read from a custom big file which has RAR files inside it (a sort of custom container). Is there a way I can write this buffer to a RAR file using sharpcompress or how should I do this? If I do this (without using any library): `File.WriteAllBytes(filename, buffer);` Then WinRAR says the file has "unknown format or is damaged". But the buffer is successfully written and the file has exactly the amount of bytes from the buffer. Thanks
Author
Owner

@ghost commented on GitHub (Dec 17, 2022):

I found it, closed.

@ghost commented on GitHub (Dec 17, 2022): I found it, closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#551