compression

.zip file created by Java doesn't support Chinese(utf-8)

跟風遠走 提交于 2019-12-20 03:21:37
问题 I want to create a .zip file using Java(jdk, ant.jar or commons-compress). But if the ZipEntry's name contains non-English(eg. Chinese, Japanese), it will display unreadable code in WinRAR or Windows Compress(commons-compress display correctly in WinRAR). Who can help me!!! 回答1: You have hit one of the Top 25 java bug. Good news is this is already resolved. Bad news it it is fixed only in JDK7. See this entry for details. Alternativlly, you can use Arcmexer (readonly). 回答2: try this by using

Is there a way to uncompress .Z files using php?

只谈情不闲聊 提交于 2019-12-20 02:49:09
问题 Is there a way to uncompress .Z files using php? 回答1: Nowadays uncompress is just nothing more than a one-liner invoking gzip with proper options. To use gzip , you don't have execute shell. You can use Zlib extension instead. I'd try something like: <?php $contents = zlib_decode(file_get_contents('/path/file.Z')); 回答2: After searching some i've found that .z files are files that were compressed using the compress program. If your php installation allows shell_exec and your webserver is

Compress a file with RAR

坚强是说给别人听的谎言 提交于 2019-12-19 16:50:55
问题 I have a text file that I want to compress after it gets an specified size. I've already seen GZipStream which works great, but RAR compression is much better. I've been looking for a library that can compress a file with RAR (I really don't care about extracting or uncompressing), but I couldn't find one yet. 回答1: As the RAR compression algorithm isn't free (only the decompression algorithm is), you won't find a library for it (or have to purchase a license). A good alternative is the LZMA

How to unpack xz file with python which contains only data but no filename?

杀马特。学长 韩版系。学妹 提交于 2019-12-19 16:48:15
问题 I have a file, which I can decompress under linux using the following command: unxz < file.xz > file.txt How can I do the same using python? If I use python3 and the tarfile module and do the following: import sys import tarfile try: with tarfile.open('temp.xz', 'r:xz') as t: t.extract() except Exception as e: print("Error:", e.strerror) I get the exception: ReadError('invalid header',) . So apparently it expects some file- or directory information which is not present in the xz file. So how

How do I take a compressed file (through indexes) and re-create the original file? (Java)

白昼怎懂夜的黑 提交于 2019-12-19 11:58:09
问题 Background of question I have been developing some code that focuses on firstly, reading a string and creating a file. Secondly, spliting a string into an array. Then getting the indexes for each word in the array and finally, removing the duplicates and printing it to a different file. I currently have made the code for this here is a link https://pastebin.com/gqWH0x0 (there is a menu system as well) but it is rather long so I have refrained from implementing it in this question. The

PHP compress files into zip

∥☆過路亽.° 提交于 2019-12-19 10:54:31
问题 Hello there okay so this is the deal i have a folder where my mp3 files are stored for single download, and now i want a feature where you can download all the mp3s at once in a zipped folder. Is it possible to zip all the files from that folder using php ( or anything really but if not PHP then please explain thoroughly) or would i have to just re-upload all the mp3s again in zipped format? Thanks you so much. 回答1: Just to demonstrate use of the undocumented addGlob() method of the

How to compress a directory with the built in .net compression classes?

倖福魔咒の 提交于 2019-12-19 10:20:07
问题 Using the System.IO.Compression namespaces classes GZIPStream and DeflateStream I successfully can compress and decompress individual files. However, if I pass a directoryname as target for compression I get a security exception. Do I have to (recursively) enumerate all files and subdirectories to be able to compress a directory? (Probably dotnetzip from codeplex will handle this better, but that is not what I am after now). 回答1: When you use GZipStream etc, you are compressing a stream ; not

Android - how to compress or downsize an image?

别说谁变了你拦得住时间么 提交于 2019-12-19 09:04:27
问题 ImageButton avatarButton = (ImageButton) findViewById(R.id.ImageButton_Avatar); avatarButton.setImageResource(R.drawable.avatar); strAvatarFilename = "Image.jpg"; final Uri imageUriToSaveCameraImageTo = Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/Folder/"+strAvatarFilename)); avatarButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent pictureIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); pictureIntent.putExtra

Create new FileStream out of a byte array

人走茶凉 提交于 2019-12-19 09:03:44
问题 I am attempting to create a new FileStream object from a byte array. I'm sure that made no sense at all so I will try to explain in further detail below. Tasks I am completing: 1) Reading the source file which was previously compressed 2) Decompressing the data using GZipStream 3) copying the decompressed data into a byte array. What I would like to change: 1) I would like to be able to use File.ReadAllBytes to read the decompressed data. 2) I would then like to create a new filestream object

Bit string nearest neighbour searching

孤人 提交于 2019-12-19 08:53:35
问题 I have hundreds of thousands of sparse bit strings of length 32 bits. I'd like to do a nearest neighbour search on them and look-up performance is critical. I've been reading up on various algorithms but they seem to target text strings rather than binary strings. I think either locally sensitive hashing or spectral hashing seem good candidates or I could look into compression. Will any of these work well for my bit string problem ? Any direction or guidance would be greatly appreciated. 回答1: