/// <summary> /// Send a binary file to the cvs server. /// </summary> /// <param name="outStream">Writable stream to the cvs server.</param> /// <param name="fileName">The name of the file to stream across.</param> public virtual void SendBinaryFile(CvsStream outStream, string fileName) { FileStream fs = File.OpenRead(fileName); byte[] data = new byte[fs.Length]; fs.Read(data, 0, data.Length); fs.Close(); outStream.SendString(data.Length.ToString() + "\n"); outStream.Write(data); }
/// <summary> /// Send a binary file to the cvs server. /// </summary> /// <param name="outStream"></param> /// <param name="fileName"></param> public override void SendBinaryFile(CvsStream outStream, string fileName) { FileStream fs = File.OpenRead(fileName); byte[] data = new byte[fs.Length]; fs.Read(data, 0, data.Length); fs.Close(); Stream oldStream = outStream.BaseStream; outStream.BaseStream = new GZipOutputStream(outStream.BaseStream); outStream.SendString("z" + data.Length.ToString() + "\n"); outStream.Write(data); outStream.BaseStream = oldStream; }