Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ZipOutputStream zos = new ZipOutputStream(bos);
- ZipEntry ze = new ZipEntry(“Temp.txt”);
- zos.putNextEntry(ze);
- FileInputStream fis = new FileInputStream("Test/File1.txt");
- byte[] buffer = new byte[1024];
- int len;
- while ((len = fis.read(buffer)) > 0) {
- //System.out.println(new String(buffer));
- zos.write(buffer, 0, len);
- }
Add Comment
Please, Sign In to add comment