C# Class Ionic.Zip.ZipEntry

Show file Open project: haf/DotNetZip.Semverd Class Usage Examples

Private Methods

Method Description
ConstructExtraField ( bool forCentralDirectory ) : byte[]
CopyMetaData ( ZipEntry source ) : void

Copy metadata that may have been changed by the app. We do this when resetting the zipFile instance. If the app calls Save() on a ZipFile, then tries to party on that file some more, we may need to Reset() it , which means re-reading the entries and then copying the metadata. I think.

CopyThroughOneEntry ( Stream outStream ) : void
CopyThroughWithNoChange ( Stream outstream ) : void
CopyThroughWithRecompute ( Stream outstream ) : void
FigureCrc32 ( ) : Int32
FileNameIsUtf8 ( char FileNameChars ) : bool
FinishOutputStream ( Stream s, CountingStream entryCounter, Stream encryptor, Stream compressor, Ionic output ) : void
GetEncodedFileNameBytes ( ) : byte[]

generate and return a byte array that encodes the filename for the entry.

side effects: generate and store into _CommentBytes the byte array for any comment attached to the entry. Also sets _actualEncoding to indicate the actual encoding used. The same encoding is used for both filename and comment.

MaybeApplyCompression ( Stream s, long streamLength ) : Stream
MaybeApplyEncryption ( Stream s ) : Stream
MaybeUnsetCompressionMethodForWriting ( int cycle ) : void
NormalizeFileName ( ) : string
NotifySaveComplete ( ) : void
OnWriteBlock ( System.Int64 bytesXferred, System.Int64 totalBytesToXfer ) : void
OnZipErrorWhileSaving ( Exception e ) : void
PostProcessOutput ( Stream s ) : void
PrepOutputStream ( Stream s, long streamLength, CountingStream &outputCounter, Stream &encryptor, Stream &compressor, Ionic &output ) : void

Prepare the given stream for output - wrap it in a CountingStream, and then in a CRC stream, and an encryptor and deflator as appropriate.

Previously this was used in ZipEntry.Write(), but in an effort to introduce some efficiencies in that method I've refactored to put the code inline. This method still gets called by ZipOutputStream.

PrepSourceStream ( ) : void

Stores the position of the entry source stream, or, if the position is already stored, seeks to that position.

This method is called in prep for reading the source stream. If PKZIP encryption is used, then we need to calc the CRC32 before doing the encryption, because the CRC is used in the 12th byte of the PKZIP encryption header. So, we need to be able to seek backward in the source when saving the ZipEntry. This method is called from the place that calculates the CRC, and also from the method that does the encryption of the file data.

The first time through, this method sets the _sourceStreamOriginalPosition field. Subsequent calls to this method seek to that position.

SetInputAndFigureFileLength ( Stream &input ) : long

Set the input stream and get its length, if possible. The length is used for progress updates, AND, to allow an optimization in case of a stream/file of zero length. In that case we skip the Encrypt and compression Stream. (like DeflateStream or BZip2OutputStream)

SetZip64Flags ( ) : void
StoreRelativeOffset ( ) : void
TraceWriteLine ( string format ) : void
WantReadAgain ( ) : bool
Write ( Stream s ) : void
WriteCentralDirectoryEntry ( Stream s ) : void
WriteHeader ( Stream s, int cycle ) : void
WriteSecurityMetadata ( Stream outstream ) : void
_WriteEntryData ( Stream s ) : void