protected int endOfFileReached()

in src/main/java/software/amazon/encryption/s3/internal/AuthenticatedCipherInputStream.java [53:71]


    protected int endOfFileReached() {
        eofReached = true;
        // Skip doFinal if it's a multipart upload but not for the last part of multipart upload
        if (!multipart || lastMultipart) {
            try {
                outputBuffer = cipher.doFinal();
                if (outputBuffer == null) {
                    return -1;
                }
                currentPosition = 0;
                return maxPosition = outputBuffer.length;
            } catch (GeneralSecurityException exception) {
                // In an authenticated scheme, this indicates a security
                // exception
                throw new S3EncryptionClientSecurityException(exception.getMessage(), exception);
            }
        }
        return -1;
    }