Skip to content

Commit

Permalink
Remove unused unzip function
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuele-f committed Apr 11, 2024
1 parent 16ccc20 commit 5e8f38b
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions app/src/main/java/com/emanuelef/remote_capture/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1002,39 +1002,6 @@ public static int getIntentFlags(int flags) {
return flags;
}

public static boolean unzip(InputStream is, String dstpath) {
try(ZipInputStream zipIn = new ZipInputStream(is)) {
ZipEntry entry = zipIn.getNextEntry();

while (entry != null) {
File dst = new File(dstpath + File.separator + entry.getName());

if (entry.isDirectory()) {
if(!dst.mkdirs()) {
Log.w("unzip", "Could not create directories");
return false;
}
} else {
// Extract file
try(BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(dst))) {
byte[] bytesIn = new byte[4096];
int read;
while ((read = zipIn.read(bytesIn)) != -1)
bos.write(bytesIn, 0, read);
}
}

zipIn.closeEntry();
entry = zipIn.getNextEntry();
}

return true;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}

public static boolean ungzip(InputStream is, String dst) {
try(GZIPInputStream gis = new GZIPInputStream(is)) {
try(BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(dst))) {
Expand Down

0 comments on commit 5e8f38b

Please sign in to comment.