compression

How do you unzip a gz file in memory using GZipStream?

萝らか妹 提交于 2020-01-30 12:05:53
问题 I'm probably doing something obviously stupid here. Please point it out! I have some C# code that is pulling down a bunch of .gz files from SFTP (using the SSH.NET Nuget package - works great!). Each gz contains only a single .CSV file inside of them. I want to keep these files in memory without hitting disk (yes, I know, server memory management concerns exist - that's fine as these files are fairly small), decompress them in memory to extract the CSV file inside, and then return a

How do you unzip a gz file in memory using GZipStream?

做~自己de王妃 提交于 2020-01-30 12:04:22
问题 I'm probably doing something obviously stupid here. Please point it out! I have some C# code that is pulling down a bunch of .gz files from SFTP (using the SSH.NET Nuget package - works great!). Each gz contains only a single .CSV file inside of them. I want to keep these files in memory without hitting disk (yes, I know, server memory management concerns exist - that's fine as these files are fairly small), decompress them in memory to extract the CSV file inside, and then return a

LZW compression on C# from string

微笑、不失礼 提交于 2020-01-30 10:58:26
问题 I'm looking for a LZW compression algorithm in C# that takes a "string" and returns a string. I've googling for hours and all I've found use MemoryStream, BinaryWriters, etc. I just want to be able to do something like: string _data = "12345"; string _result = CompressToLZW(_data); and then pass that string via Ajax to the browser. I already have the LZW decompression algorithm for javascript (http://rosettacode.org/wiki/LZW_compression#JavaScript) Thanks.- UPDATE: This is the code I'm using

How is a .zip compressed archive structured?

旧城冷巷雨未停 提交于 2020-01-30 04:07:51
问题 I'm looking into how popular compression algorithms work so I could possibly implement my own zip archiver. Are there any resources about how exactly zip works? How is a .zip compressed archive structured? 回答1: ZIP format documentation DEFLATE algorithm ZLib compressed data format 来源: https://stackoverflow.com/questions/4776815/how-is-a-zip-compressed-archive-structured

Poco::Zip compress/decompress

我与影子孤独终老i 提交于 2020-01-25 08:00:13
问题 After successfully compress/decompress using Poco::Zip, I found that I cannot decompress the .zip file which I zip it with my Compress method and vice-versa. But I can decompress my zip file with other tools like 7z or WinRAR and of course, if I compress the zip file using WinRAR or 7z, I can decompress the zip file using my decompress method. I don't know what's wrong here? Here is my compress method: void ZipFile(string source, string target){ Poco::File aFile(source); if (aFile.exists()) {

bash uncompress gz and store in variable

给你一囗甜甜゛ 提交于 2020-01-25 05:20:09
问题 I need to uncompress a .gz file and store it in a variable, so I can use it later. So, the idea is that I generate *.fastq.gz files, and I need to uncompress them and keep just the *.fastq file. Then, I would like to store its name in a variable, so I can call the file for further processing. Here, there is the code I am executing: input: $file.fastq.gz Where $file is the name of the file (it changes, as this code is inside a loop) reads=$(gunzip $file.fastq) echo $reads Does anybody know

Compress large file using SharpZipLib causing Out Of Memory Exception

大城市里の小女人 提交于 2020-01-24 23:59:27
问题 I have a 453MB XML file which I'm trying to compress to a ZIP using SharpZipLib. Below is the code I'm using to create the zip, but it's causing an OutOfMemoryException . This code successfully compresses a file of 428MB. Any idea why the exception is happening, as I can't see why, as my system has plenty of memory available. public void CompressFiles(List<string> pathnames, string zipPathname) { try { using (FileStream stream = new FileStream(zipPathname, FileMode.Create, FileAccess.Write,

Windows command line compression/extraction tool?

一世执手 提交于 2020-01-24 20:40:35
问题 I need to write a batch file to unzip files to their current folder from a given root folder. Folder 0 |----- Folder 1 | |----- File1.zip | |----- File2.zip | |----- File3.zip | |----- Folder 2 | |----- File4.zip | |----- Folder 3 |----- File5.zip |----- FileN.zip So, I wish that my batch file is launched like so: ocd.bat /d="Folder 0" Then, make it iterate from within the batch file through all of the subfolders to unzip the files exactly where the .zip files are located. So here's my

Issue in gzip compression

余生长醉 提交于 2020-01-24 13:03:29
问题 I am using gzip to compress the loading files. For that i have written the following code in server.xml in tomcat. <Connector compressableMimeType="text/html,text/xml,text/json,text/javascript,text/css,text/plain,application/json,application/javascript" compression="on" compressionMinSize="2048" connectionTimeout="200000" noCompressionUserAgents="gozilla, traviata" port="8080" protocol="HTTP/1.1" redirectPort="8443"/> What i get is "Content-Encoding : gzip". But for some files it is not get

Application is not loading after upgrading to payara 4.1.1.171

纵饮孤独 提交于 2020-01-24 11:46:05
问题 Upgraded server from glassfish 3.1 to payara 4.1.1.171 , took the glassfish config backup and restored to payara 4.1.1.171 . After that my application is not loading and in console it throws this error net::ERR_INCOMPLETE_CHUNKED_ENCODING If i change the compression attribute to 'off' then application is loading . <http request-timeout-seconds="2700" chunking-enabled="false" compressable-mime-type="text/html,text/xml,text/plain,image/gif,image/jpeg,image/png,text/css,text/javascript