Code example for ByteArrayOutputStream

Methods: size

0
    protected int engineGetOutputSize( 
        int     inputLen) 
    { 
        if (state == Cipher.ENCRYPT_MODE || state == Cipher.WRAP_MODE)
        { 
            return buffer.size() + inputLen + 20; /* SHA1 MAC size */
        } 
        else if (state == Cipher.DECRYPT_MODE || state == Cipher.UNWRAP_MODE)
        { 
            return buffer.size() + inputLen - 20;
        } 
        else 
        { 
            throw new IllegalStateException("cipher not initialised");
        } 
    } 
 
    protected AlgorithmParameters engineGetParameters() 
    { 
        if (engineParam == null)
        {