[Logo]
Forums Register Login
zipping file
a byte array needs to be zipped and returned, without making use of intermediate temporary file.......i am able to zip as follows:


ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName.toString()));
FileInputStream fileStream = new FileInputStream(newFile);
out.putNextEntry(new ZipEntry(zipFileName.toString()));
int len;
while((len = fileStream.read(buf)) > 0) {
out.write(buf, 0, len);
}
out.closeEntry();
fileStream.close();

out.close();
then read the zipped file

in doing so i am first making a zipped file and then reading that file to retrieve the zipped byte array.i dont want this intermediate file to be created and still be able to get the byte array.Any help welcome
Use ByteArrayOutputStream rather than FileOutputStream.
thanks.........
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Dec 14, 2017 23:50:54.