1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-22 14:52:25 +02:00

Add a few more comments

This commit is contained in:
MPeter 2022-09-02 14:28:58 +02:00
parent a0782d318b
commit 15803eedea

View File

@ -13,6 +13,9 @@ import java.util.zip.ZipInputStream;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
/**
* Utility class for recognition and reading of ZIP archives.
*/
public class ZipFile { public class ZipFile {
private static final Logger LOG = LoggerFactory.getLogger(ZipFile.class); private static final Logger LOG = LoggerFactory.getLogger(ZipFile.class);
public static final byte[] ZIP_HEADER = new byte[]{ public static final byte[] ZIP_HEADER = new byte[]{
@ -22,16 +25,17 @@ public class ZipFile {
private final byte[] zipBytes; private final byte[] zipBytes;
/** /**
* Open ZIP file from byte array in memory * Open ZIP file from byte array already in memory.
* @param zipBytes data to handle as a ZIP file * @param zipBytes data to handle as a ZIP file.
*/ */
public ZipFile(byte[] zipBytes) { public ZipFile(byte[] zipBytes) {
this.zipBytes = zipBytes; this.zipBytes = zipBytes;
} }
/** /**
* Open ZIP file from InputStream * Open ZIP file from InputStream.<br>
* @param inputStream data to handle as a ZIP file * This will read the entire file into memory at once.
* @param inputStream data to handle as a ZIP file.
*/ */
public ZipFile(InputStream inputStream) throws IOException { public ZipFile(InputStream inputStream) throws IOException {
this.zipBytes = readAllBytes(inputStream); this.zipBytes = readAllBytes(inputStream);