Hi friends,
import java.io.*;
import java.util.zip.*;
public class ReadCompressedPrimes
{
public static void main(String[] args)
{
try
{
FormatWriter out = new FormatWriter(
new BufferedWriter(
new FileWrite(FileDescriptor.out)));
String dirName = "C:/data/mukti/java1";
String zipName = "NewPrimes.zip";
File myPrimeZip = new File(dirName,zipName);
ZipOutputStream myZipFile =new ZipOutputStream
(new FileOutputStream(myPrimeZip));
ZipEntry myZipEntry = myZipFile.getNextEntry();
DataOutputStream primesIn = new DataOutputStream(
new BufferedOutputStream(myZipFile));
long [] primes = new long[6];
boolean EOF = false;
while(!EOF)
{
int index = 0;
try
{
for(index=0;index<primes.length;index++)>
primes[index]=primesIn.readLong();
}
catch(EOFException e)
{
EOF = true;
}
for(int j=0;j<index;j++)>
out.print(primes[j]);
out.println();
}
out.close();
primesIn.close();
}
catch(FileNotFoundException e)
{
System.err.println(e);
return;
}
catch(IOException e)
{
System.err.println("Error reading input file" + e);
return;
}
}
}
The code written above when complied gives error...
C:\Data\Mukti\Java\ReadCompressedPrimes.java:25: cannot resolve symbol
symbol : method getNextEntry ()
location: class java.util.zip.ZipOutputStream
ZipEntry myZipEntry = myZipFile.getNextEntry();
^
C:\Data\Mukti\Java\ReadCompressedPrimes.java:40: cannot resolve symbol
symbol : method readLong ()
location: class java.io.DataOutputStream
primes[index]=primesIn.readLong();
^
Please can someone help me.....
Thanks.
import java.io.*;
import java.util.zip.*;
public class ReadCompressedPrimes
{
public static void main(String[] args)
{
try
{
FormatWriter out = new FormatWriter(
new BufferedWriter(
new FileWrite(FileDescriptor.out)));
String dirName = "C:/data/mukti/java1";
String zipName = "NewPrimes.zip";
File myPrimeZip = new File(dirName,zipName);
ZipOutputStream myZipFile =new ZipOutputStream
(new FileOutputStream(myPrimeZip));
ZipEntry myZipEntry = myZipFile.getNextEntry();
DataOutputStream primesIn = new DataOutputStream(
new BufferedOutputStream(myZipFile));
long [] primes = new long[6];
boolean EOF = false;
while(!EOF)
{
int index = 0;
try
{
for(index=0;index<primes.length;index++)>
primes[index]=primesIn.readLong();
}
catch(EOFException e)
{
EOF = true;
}
for(int j=0;j<index;j++)>
out.print(primes[j]);
out.println();
}
out.close();
primesIn.close();
}
catch(FileNotFoundException e)
{
System.err.println(e);
return;
}
catch(IOException e)
{
System.err.println("Error reading input file" + e);
return;
}
}
}
The code written above when complied gives error...
C:\Data\Mukti\Java\ReadCompressedPrimes.java:25: cannot resolve symbol
symbol : method getNextEntry ()
location: class java.util.zip.ZipOutputStream
ZipEntry myZipEntry = myZipFile.getNextEntry();
^
C:\Data\Mukti\Java\ReadCompressedPrimes.java:40: cannot resolve symbol
symbol : method readLong ()
location: class java.io.DataOutputStream
primes[index]=primesIn.readLong();
^
Please can someone help me.....
Thanks.