Latest Java Compression Program 2011

Latest Java Compression Program 2011

Here you can see the Java Compression Program and it is simple Java Compression Program.

import java.io.*;
import java.util.zip.GZIPOutputStream;
class comp
{
public static void main(String args[])throws Exception
{
try
{
String fn=("CurlsbyCandy.jpg");
String on=("op.odt");
FileInputStream in=new FileInputStream(fn);
GZIPOutputStream out=new GZIPOutputStream(new FileOutputStream(on));
byte b[]=new byte[200];
int n;
while((n=in.read(b,0,100))!=-1)
{
out.write(b,0,n);
}
out.close();
System.out.println("FileCompressed");
}
catch(Exception e)
{
System.out.println("ERROR"+e);
}
}
}


These is a Best Compression Program for Java . New Java Compression Program.

Recommended Posts



Privacy Policy

All the Colleges, Schools, Universities, Top lists, Interview question paper, Programming, Tips, Tutorials and all other's just information purpose only. We are not responsible for any damages caused to you.