ICSharpCode.SharpZipLib.Zip.ZipFile.CopyDescriptorBytes C# (CSharp) Метод

CopyDescriptorBytes() приватный Метод

private CopyDescriptorBytes ( ZipUpdate update, Stream dest, Stream source ) : void
update ZipUpdate
dest Stream
source Stream
Результат void
        private void CopyDescriptorBytes(ZipUpdate update, Stream dest, Stream source) {
            int bytesToCopy=GetDescriptorSize(update);

            if (bytesToCopy>0) {
                byte[] buffer=GetBuffer();

                while (bytesToCopy>0) {
                    int readSize=Math.Min(buffer.Length, bytesToCopy);

                    int bytesRead=source.Read(buffer, 0, readSize);
                    if (bytesRead>0) {
                        dest.Write(buffer, 0, bytesRead);
                        bytesToCopy-=bytesRead;
                    } else {
                        throw new ZipException("Unxpected end of stream");
                    }
                }
            }
        }