Ejemplo n.º 1
0
Archivo: GZip.cs Proyecto: Vita7y/GZip
        public GZipCompress(Stream toRead, Stream toWrite, int frameLength, int headerId)
        {
            _streamToRead  = toRead;
            _streamToWrite = toWrite;
            _frameLength   = frameLength;
            _headerId      = headerId;

            FramesCount = _streamToRead.Length / _frameLength + (_streamToRead.Length % _frameLength > 0 ? 1 : 0);
            var header = new WindowHeader(1, 1, _streamToRead.Length, FramesCount);

            FrameHelper.WriteWindowHeaderToStream(_streamToWrite, header);
        }
Ejemplo n.º 2
0
        public static void WriteWindowHeaderToStream(Stream stream, WindowHeader header)
        {
            var bufWindowHeader = header.StructToByteArray();

            stream.Write(bufWindowHeader, 0, bufWindowHeader.Length);
        }