ICSharpCode.SharpZipLib.Zip.ZipOutputStream.SetComment C# (CSharp) Méthode

SetComment() public méthode

Set the zip file comment.
/// The converted comment is longer than 0xffff bytes. ///
public SetComment ( string comment ) : void
comment string /// The comment text for the entire archive. ///
Résultat void
        public void SetComment(string comment)
        {
            // TODO: Its not yet clear how to handle unicode comments here.
            byte[] commentBytes = ZipConstants.ConvertToArray(comment);
            if (commentBytes.Length > 0xffff) {
                throw new ArgumentOutOfRangeException(nameof(comment));
            }
            zipComment = commentBytes;
        }

Usage Example

Exemple #1
0
        public void CommentTooLong()
        {
            MemoryStream    ms = new MemoryStream();
            ZipOutputStream s  = new ZipOutputStream(ms);

            s.SetComment(new String('A', 65536));
        }
All Usage Examples Of ICSharpCode.SharpZipLib.Zip.ZipOutputStream::SetComment