/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

package com.pullenti.unitext.internal.zip;

// This class contains constants used for Zip format files
public class ZipConstants {

    public static final int VERSIONMADEBY = 51;

    public static final int VERSIONSTRONGENCRYPTION = 50;

    public static final int VERSION_AES = 51;

    public static final int VERSIONZIP64 = 45;

    public static final int LOCALHEADERBASESIZE = 30;

    public static final int ZIP64DATADESCRIPTORSIZE = 24;

    public static final int DATADESCRIPTORSIZE = 16;

    public static final int CENTRALHEADERBASESIZE = 46;

    public static final int ENDOFCENTRALRECORDBASESIZE = 22;

    public static final int CRYPTOHEADERSIZE = 12;

    public static final int LOCALHEADERSIGNATURE;

    public static final int LOCSIG;

    public static final int SPANNINGSIGNATURE;

    public static final int SPANNINGSIG;

    public static final int SPANNINGTEMPSIGNATURE;

    public static final int SPANTEMPSIG;

    public static final int DATADESCRIPTORSIGNATURE;

    public static final int EXTSIG;

    public static final int CENSIG;

    public static final int CENTRALHEADERSIGNATURE;

    public static final int ZIP64CENTRALFILEHEADERSIGNATURE;

    public static final int CENSIG64;

    public static final int ZIP64CENTRALDIRLOCATORSIGNATURE;

    public static final int ARCHIVEEXTRADATASIGNATURE;

    public static final int CENTRALHEADERDIGITALSIGNATURE;

    public static final int CENDIGITALSIG;

    public static final int ENDOFCENTRALDIRECTORYSIGNATURE;

    public static final int ENDSIG;

    public static String convertToString(byte[] data, int count) {
        if (data == null) 
            return "";
        String tmp = com.pullenti.util.TextHelper.readStringFromBytes(data, false, false);
        return tmp;
    }

    public static String convertToString0(byte[] data) {
        if (data == null) 
            return "";
        return convertToString(data, data.length);
    }

    public static String convertToStringExt(int flags, byte[] data, int count) {
        if (data == null) 
            return "";
        if (((flags & (GeneralBitFlags.UNICODETEXT.value()))) != 0) 
            return com.pullenti.util.MiscHelper.decodeStringUtf8(data, 0, count);
        else 
            return convertToString(data, count);
    }

    public static String convertToStringExt0(int flags, byte[] data) {
        if (data == null) 
            return "";
        if (((flags & (GeneralBitFlags.UNICODETEXT.value()))) != 0) 
            return com.pullenti.util.MiscHelper.decodeStringUtf8(data, 0, data.length);
        else 
            return convertToString(data, data.length);
    }

    public static byte[] convertToArrayStr(String str) {
        if (str == null) 
            return new byte[0];
        return com.pullenti.util.MiscHelper.encodeStringUtf8(str, false);
    }

    public static byte[] convertToArray(int flags, String str) {
        if (str == null) 
            return new byte[0];
        if (((flags & (GeneralBitFlags.UNICODETEXT.value()))) != 0) 
            return com.pullenti.util.MiscHelper.encodeStringUtf8(str, false);
        else 
            return convertToArrayStr(str);
    }

    private ZipConstants() {
    }

    
    static {
        LOCALHEADERSIGNATURE = (((int)'P') | (((int)'K') << 8) | (3 << 16)) | (4 << 24);
        LOCSIG = (((int)'P') | (((int)'K') << 8) | (3 << 16)) | (4 << 24);
        SPANNINGSIGNATURE = (((int)'P') | (((int)'K') << 8) | (7 << 16)) | (8 << 24);
        SPANNINGSIG = (((int)'P') | (((int)'K') << 8) | (7 << 16)) | (8 << 24);
        SPANNINGTEMPSIGNATURE = (((int)'P') | (((int)'K') << 8) | (((int)'0') << 16)) | (((int)'0') << 24);
        SPANTEMPSIG = (((int)'P') | (((int)'K') << 8) | (((int)'0') << 16)) | (((int)'0') << 24);
        DATADESCRIPTORSIGNATURE = (((int)'P') | (((int)'K') << 8) | (7 << 16)) | (8 << 24);
        EXTSIG = (((int)'P') | (((int)'K') << 8) | (7 << 16)) | (8 << 24);
        CENSIG = (((int)'P') | (((int)'K') << 8) | (1 << 16)) | (2 << 24);
        CENTRALHEADERSIGNATURE = (((int)'P') | (((int)'K') << 8) | (1 << 16)) | (2 << 24);
        ZIP64CENTRALFILEHEADERSIGNATURE = (((int)'P') | (((int)'K') << 8) | (6 << 16)) | (6 << 24);
        CENSIG64 = (((int)'P') | (((int)'K') << 8) | (6 << 16)) | (6 << 24);
        ZIP64CENTRALDIRLOCATORSIGNATURE = (((int)'P') | (((int)'K') << 8) | (6 << 16)) | (7 << 24);
        ARCHIVEEXTRADATASIGNATURE = (((int)'P') | (((int)'K') << 8) | (6 << 16)) | (7 << 24);
        CENTRALHEADERDIGITALSIGNATURE = (((int)'P') | (((int)'K') << 8) | (5 << 16)) | (5 << 24);
        CENDIGITALSIG = (((int)'P') | (((int)'K') << 8) | (5 << 16)) | (5 << 24);
        ENDOFCENTRALDIRECTORYSIGNATURE = (((int)'P') | (((int)'K') << 8) | (5 << 16)) | (6 << 24);
        ENDSIG = (((int)'P') | (((int)'K') << 8) | (5 << 16)) | (6 << 24);
    }
}
