private static int base64EstimatedLength()

in src/main/java/com/microsoft/azure/proton/transport/ws/impl/Base64.java [131:147]


    private static int base64EstimatedLength(final byte[] base64sToDecode) {
        int estimatedLength;

        if (base64sToDecode.length == 0) {
            return 0;
        }

        estimatedLength = base64sToDecode.length / BASE64_GROUP_SIZE * BYTE_GROUP_SIZE;
        if (base64sToDecode[base64sToDecode.length - 1] == BASE64_PAD) {
            if (base64sToDecode[base64sToDecode.length - 2] == BASE64_PAD) {
                estimatedLength--;
            }
            estimatedLength--;
        }

        return estimatedLength;
    }