answersLogoWhite

0

Java program to read and compress a file?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

I dont know you are looking for write new program to compress the data.. I am providing code to zip the file in Java.

ZipOutputStream zipOutStream = new ZipOutputStream( new BufferedOutputStream( new FileOutputStream( ZipFileName )) );
BufferedInputStream bufferInStram = new BufferedInputStream( new FileInputStream(FileToXip), 2000 );
ZipEntry entry = new ZipEntry( excelFileName );
zipOutStream.putNextEntry( entry );

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Java program to read and compress a file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Program in Java to create file and copy content of an existing file to it?

You need to use File class to create file in java and than Reader class implementation such as BufferedReder to read content.


Why 2 files in java program?

There are programming languages in which the source file is read and interpreted directly, but those are usually slower than when the program is compiled, to an EXE, or as in Java, for a virtual machine.


How read xml file in java?

Java provides several XML Parsers like DOM, SAX or JDOM and API javax.xml.parsers by using those we can easily read xml files in Java. DOM is quickest and easiest way to read XMlL file in Java.


How do you make an antivirus program using Java?

A running java program only has access to the memory allocated to it by the Java Runtime Environment. Java by design does not allow access to absolute memory locations which is required to scan for memory resident viruses. A Java-based anti-virus program can still read a virus-signature file and use it to scan for those patterns in files to identify possible infected files.


How do you read and write video file in java?

you can use inputstream for reading the file java.io.fileinputstream and write the file using outputstream..


What is a compatible file?

A compatible file is a file name extension (or format) that a program can read.


What program do you use to read txt file?

A .txt can be read with notepad.


How do you open class files on windows 7?

right click on the class file ,go to properties and change open with to notepad, and then it can be opened.. :) While that may work, it is almost impossible to read as it is. What I suggest is downloading a java decompiler, then open it with that. It will convert it to what you would see in a .java file, which you are able to read if you know java programming.


What program do you need to read a PDF file?

adobe, of course


How do you read contents of pdf file using java?

Not sure if Java is capable of that but you can download a PDF text reader at this site: http://www.ctdeveloping.com/ctdeveloping/products/pdftextreader_info.asp


How do you read a pdf file using java?

Not sure if Java is capable to do that but you can download a PDF text reader using this http: http://www.ctdeveloping.com/ctdeveloping/products/pdftextreader_info.asp


A method for reducing file size to speed sending it on the internet?

First, you will need a program to compress the file. You can find one at www.download.com. The site works like a search engine, so just do a search for file compression. One of the more popular ones is winzip, however, you will want to read the description of the programs to ensure they meet your needs. Things to consider when looking for a program to download are system requirements, supported files, and ease of use. Once you have the program download, the best advice is to read the help files for the specific program. Since each program varies, it is impossible to give you further instructions without knowing which program you choose to use.