File tree 1 file changed +0
-33
lines changed
app/src/main/java/com/emanuelef/remote_capture
1 file changed +0
-33
lines changed Original file line number Diff line number Diff line change @@ -1002,39 +1002,6 @@ public static int getIntentFlags(int flags) {
1002
1002
return flags ;
1003
1003
}
1004
1004
1005
- public static boolean unzip (InputStream is , String dstpath ) {
1006
- try (ZipInputStream zipIn = new ZipInputStream (is )) {
1007
- ZipEntry entry = zipIn .getNextEntry ();
1008
-
1009
- while (entry != null ) {
1010
- File dst = new File (dstpath + File .separator + entry .getName ());
1011
-
1012
- if (entry .isDirectory ()) {
1013
- if (!dst .mkdirs ()) {
1014
- Log .w ("unzip" , "Could not create directories" );
1015
- return false ;
1016
- }
1017
- } else {
1018
- // Extract file
1019
- try (BufferedOutputStream bos = new BufferedOutputStream (new FileOutputStream (dst ))) {
1020
- byte [] bytesIn = new byte [4096 ];
1021
- int read ;
1022
- while ((read = zipIn .read (bytesIn )) != -1 )
1023
- bos .write (bytesIn , 0 , read );
1024
- }
1025
- }
1026
-
1027
- zipIn .closeEntry ();
1028
- entry = zipIn .getNextEntry ();
1029
- }
1030
-
1031
- return true ;
1032
- } catch (IOException e ) {
1033
- e .printStackTrace ();
1034
- return false ;
1035
- }
1036
- }
1037
-
1038
1005
public static boolean ungzip (InputStream is , String dst ) {
1039
1006
try (GZIPInputStream gis = new GZIPInputStream (is )) {
1040
1007
try (BufferedOutputStream bos = new BufferedOutputStream (new FileOutputStream (dst ))) {
You can’t perform that action at this time.
0 commit comments