use this code to unzip a .gzip file:
try {
// Open the compressed file
String inFilename = "infile.gzip";
GZIPInputStream in = new GZIPInputStream(new FileInputStream(inFilename));
// Open the output file
String outFilename = "outfile";
OutputStream out = new FileOutputStream(outFilename);
// Transfer bytes from the compressed file to the output file
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
// Close the file and stream
in.close();
out.close();
} catch (IOException e) {
}
that's is ok...
I 've already used it....
I am able to read the contents of the file ....
But my requirement is to minimize the reading time of the file.....
I want to pick some line on a random basis...
So if u can tell me some alternative which meets my requirement ,....
It would be grateful...
> use this code to unzip a .gzip file:
>
> ...
Source: http://www.exampledepot.com/egs/java.util.zip/UncompressFile.html
Thanks for reply ....As i earlier Stated that I already follwed these steps...
I am, able to read the GZIP file ....
But i want to access it Randomly....
> ...
> Thanks for reply ....As i earlier Stated that I
> already follwed these steps...
> I am, able to read the GZIP file ....
> But i want to access it Randomly....
I wasn't replying to you, but to java_2006 who is frequently posting code he "borrowed" from somewhere without mentioning it's not his work (aka plagiarism).