Code example for ByteArrayOutputStream

Methods: size, write

0
        catch (InvalidAlgorithmParameterException e)
        { 
            // this shouldn't happen 
            throw new RuntimeException("Eeeek! " + e.toString(), e);
        } 
    } 
 
    protected byte[] engineUpdate( 
        byte[]  input,
        int     inputOffset,
        int     inputLen) 
    { 
        bOut.write(input, inputOffset, inputLen);
 
        if (cipher instanceof RSABlindedEngine)
        { 
            if (bOut.size() > cipher.getInputBlockSize() + 1)
            { 
                throw new ArrayIndexOutOfBoundsException("too much data for RSA block");
            } 
        } 
        else