Actually i'm using a method to zip a generated txt file in my android app, in the following txt file there are data separed by enter like
123213213
123213132
424242244
But if i zip this file and unzip it on my computer the following file will be
123213213□123213132□424242244
Here is the method that i'm using to zip the file
public void zip(String files, String zipFile) throws IOException {
BufferedInputStream origin;
try (ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)))) {
byte[] data = new byte[BUFFER_SIZE];
FileInputStream fi = new FileInputStream(files);
origin = new BufferedInputStream(fi, BUFFER_SIZE);
try {
ZipEntry entry = new ZipEntry(files.substring(files.lastIndexOf("/") + 1));
out.putNextEntry(entry);
int count;
while ((count = origin.read(data, 0, BUFFER_SIZE)) != -1) {
out.write(data, 0, count);
}
} finally {
origin.close();
}
}
}