static int calculateOutNetBufSize(int pendingBytes) {
        return min(SSL3_RT_MAX_PACKET_SIZE,
                MAX_ENCRYPTION_OVERHEAD_LENGTH + min(MAX_ENCRYPTION_OVERHEAD_DIFF, pendingBytes));
    }
Calculates the minimum bytes required in the encrypted output buffer for the given number of
plaintext source bytes.
common/src/main/java/org/conscrypt/SSLUtils.java