Beispiel #1
0
        public static void Send(Socket socket, byte[] byteArray)
        {
            byteArray = Compresser.Compress(byteArray);
            socket.Send(BitConverter.GetBytes(byteArray.Length));
            socket.Send(byteArray);
            int checkSum = CalculateChecksum(byteArray);

            socket.Send(BitConverter.GetBytes(checkSum));
        }
Beispiel #2
0
        public string Compress(string place, ArchiveOptions archiveOptions)
        {
            if (!Info.Exists)
            {
                return(null);
            }
            string compressedName = PathHelper.GetNameOfNewFile(
                place + "\\" + Info.Name,
                COMPRESSED_TYPE);

            compresser.Compress(Info.FullName, compressedName, archiveOptions);
            return(compressedName);
        }