.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

ZipArchive.AddByteArray(String, Byte[]) Method

Creates a zip item from a byte array and adds it to archive.

Namespace: DevExpress.Compression

Assembly: DevExpress.Docs.v21.1.dll


public ZipByteArrayItem AddByteArray(
    string name,
    byte[] content


Name Type Description
name String

A string that is the name of the zip item.

content Byte[]

A Byte[] array to compress and store in a zip item.


Type Description

A ZipByteArrayItem object that is the compressed array of bytes in an archive.


This code snippet adds a byte array to an archive as an item with the name “myByteArray” and outputs zipped data to the stream.

using DevExpress.Compression;
        public void ArchiveByteArray() {
            byte[] myByteArray = Enumerable.Repeat((byte)0x78, 10000).ToArray();
            using (Stream myZippedStream = new FileStream("Documents\\ArchiveByteArray.zip", FileMode.Create)) {
                using (ZipArchive archive = new ZipArchive()) {
                    archive.AddByteArray("myByteArray", myByteArray);
See Also