mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
allow ZipFile to accept InputStreams
This commit is contained in:
parent
e7bd1620fe
commit
56d087da2f
@ -23,12 +23,20 @@ public class ZipFile implements AutoCloseable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Open ZIP file from byte array in memory
|
* Open ZIP file from byte array in memory
|
||||||
* @param zipBytes
|
* @param zipBytes data to handle as a ZIP file
|
||||||
*/
|
*/
|
||||||
public ZipFile(byte[] zipBytes) {
|
public ZipFile(byte[] zipBytes) {
|
||||||
zipInputStream = new ZipInputStream(new ByteArrayInputStream(zipBytes));
|
zipInputStream = new ZipInputStream(new ByteArrayInputStream(zipBytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open ZIP file from InputStream
|
||||||
|
* @param inputStream data to handle as a ZIP file
|
||||||
|
*/
|
||||||
|
public ZipFile(InputStream inputStream) {
|
||||||
|
zipInputStream = new ZipInputStream(inputStream);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if data resembles a ZIP file.<br>
|
* Checks if data resembles a ZIP file.<br>
|
||||||
* The check is not infallible: it may report self-extracting or other exotic ZIP archives as not a ZIP file, and it may report a corrupted ZIP file as a ZIP file.
|
* The check is not infallible: it may report self-extracting or other exotic ZIP archives as not a ZIP file, and it may report a corrupted ZIP file as a ZIP file.
|
||||||
|
Loading…
Reference in New Issue
Block a user