compression

android get compressed size of a file in a zipfile

Deadly 提交于 2019-12-11 05:54:22
问题 Is there a way to get the compressed filesize of one file inside a zip archive? ZipEntry.getSize() gives the uncompressed size. 回答1: That was easy to find out... zentr.getCompressedSize(); http://developer.android.com/reference/java/util/zip/ZipEntry.html#getCompressedSize() 来源: https://stackoverflow.com/questions/12372759/android-get-compressed-size-of-a-file-in-a-zipfile

why do certain zip files have unknown file content

别说谁变了你拦得住时间么 提交于 2019-12-11 05:53:39
问题 background I stumbled across this problem here analysis according to the java docs for ZipEntry, sometimes requesting the size of a zipfile entry simply returns -1 However, running the command $ unzip -l b17c024e-89f1-42f7-a546-91d46610cedb.epub Archive: b17c024e-89f1-42f7-a546-91d46610cedb.epub Length Date Time Name -------- ---- ---- ---- 20 01-27-12 11:17 mimetype 2378 04-20-12 10:12 OEBPS/hayat-ghayr.html 6436 02-06-12 11:06 OEBPS/content.opf 112579 01-27-12 11:25 OEBPS/images/978-614-425

Compression using LZ4Net

荒凉一梦 提交于 2019-12-11 05:32:56
问题 I'm trying to compress multiple files with lz4net, but I don't even know how to begin. I have string[] or List<string> with filepaths (and relative paths) and want to compress it with lz4 to one file. Later I want to decompress it with taking care about the relative paths. 回答1: Download the LZ4 dll. Create a buffer for each file: public byte[] FileToByteArray(string fileName) { byte[] buff = null; FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); BinaryReader br = new

PDF compression java

我是研究僧i 提交于 2019-12-11 05:03:46
问题 I am trying to optimize PDF file size generated by our Java based system. My first thought is to reduce the size of images in them by converting them to gray scale. Do you know any other tool, preferably a java library or component, which can be used for PDF documents to shrink the size? 回答1: If your input images have larger dimensions I would suggest that you shrink them before adding them to the pdf file. In pure Java you can do it wish something like Image image; // Say you have loaded the

Compress a Byte Array Image without Scaling using .Net C#

旧街凉风 提交于 2019-12-11 04:43:36
问题 I'm building an AngularJS Application, for Service I'm using .NET C# for coding purpose. I'm retrieving Images from SQL Server as Byte Array and I'm sending the Byte Array to AngularJS and it displays the Image in the HTML. I followed the same as like in the post Load image from C# Byte array and place image in html tag using AngularJS But I'm facing the performance issue in my data. My database contains the byte array size is approx. 2 to 3 MB. So, based on Internet Bandwidth its struggling

DeflateStream CopyTo writes nothing and throws no exceptions

孤者浪人 提交于 2019-12-11 04:34:23
问题 I've basically copied this code sample directly from msdn with some minimal changes. The CopyTo method is silently failing and I have no idea why. What would cause this behavior? It is being passed a 78 KB zipped folder with a single text file inside of it. The returned FileInfo object points to a 0 KB file. No exceptions are thrown. public static FileInfo DecompressFile(FileInfo fi) { // Get the stream of the source file. using (FileStream inFile = fi.OpenRead()) { // Get original file

Pyinstaller and cython application files way too huge

十年热恋 提交于 2019-12-11 04:25:02
问题 I am creating executables that can run on my laptop without having Python installed. The below works perfectly... pyinstaller -r file_a.so,dll,file_a.so -r file_b.so,dll,file_b.so -F ./bin/hello However each executable is 181,177kb+. When before the job was about 10kbs. I can compress that down to 170,100kbs. Any ideas on how I can compress this further. It is using cython + Pyinstaller which works perfectly however the only issue is the huge size..... 来源: https://stackoverflow.com/questions

What are the algorithms behind the Level 1 and Level 2 compression using Jlink (Java 9)?

筅森魡賤 提交于 2019-12-11 04:07:31
问题 The documentation (https://docs.oracle.com/javase/9/tools/jlink.htm#JSWOR-GUID-CECAC52B-CFEE-46CB-8166-F17A8E9280E9) says: Level 1 -> Constant String sharing Level 2 -> zip My questions are: 1). Which strings get shared ? 2). Who share these strings ? 3). Compression in Level 2 does not create a zip file. Then how it is a zip compression ? 来源: https://stackoverflow.com/questions/48180953/what-are-the-algorithms-behind-the-level-1-and-level-2-compression-using-jlink

How do I reduce the quality of an image in byte format on Android?

旧街凉风 提交于 2019-12-11 03:56:14
问题 Using resources from StackOverflow and other helpful websites, I was successful in creating an application that can upload an image taken by the camera application on an Android phone. The only trouble is, the phone I have right now takes very high-quality pictures, resulting in a long wait-time for uploads. I read about converting images from jpeg to a lower rate (smaller size or just web-friendly sizes), but the code I am using right now saves the captured image as a byte (see code below).

CPU huffman compression faster after first execution?

牧云@^-^@ 提交于 2019-12-11 03:33:26
问题 I've recently constructed a CPU implementation of Huffman encoding in C++. I've also constructed a GPU version in CUDA in order to compare times, but I've come across a problem when testing the CPU's times: When stress testing by compressing large files, for instance a 97mb text file with almost every letter in the alphabet and various other ascii characters, my CPU implementation will take approximately 8.3 seconds the first time it executes. After that, the time drops significantly to 1.7