Java 8 ShortBufferException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ShortBufferException class.

This code example shows how to use the following methods:
            throw new ShortBufferException();
 
        byte[] buf = engineUpdate(input, inputOffset, inputLen);
        result = buf.length;
        if ((output.length - outputOffset) < result)
            throw new ShortBufferException();
 
        System.arraycopy(buf, 0, output, outputOffset, result);
        return result;
    } 
 
    @Override 
    protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException {
        return cipherInstance.doFinal(input, inputOffset, inputLen);
    } 
 
    @Override 
    protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException {
        int result = engineGetOutputSize(inputLen);
        if ((output.length - outputOffset) < result)
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    { 
        byte[] secret = engineGenerateSecret();
 
        if (sharedSecret.length - offset < secret.length)
        { 
            throw new ShortBufferException(kaAlgorithm + " key agreement: need " + secret.length + " bytes");
        } 
 
        System.arraycopy(secret, 0, sharedSecret, offset, secret.length);
         
        return secret.length;
    } 
 
    protected SecretKey engineGenerateSecret(
        String algorithm)
        throws NoSuchAlgorithmException 
    { 
        byte[] secret = bigIntToBytes(result);
 
        // BEGIN android-removed 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
 
        byte[]  secret = bigIntToBytes(result);
 
        if (sharedSecret.length - offset < secret.length)
        { 
            throw new ShortBufferException("DHKeyAgreement - buffer too short");
        } 
 
        System.arraycopy(secret, 0, sharedSecret, offset, secret.length);
 
        return secret.length;
    } 
 
    protected SecretKey engineGenerateSecret(
        String algorithm) 
    { 
        if (x == null)
        { 
            throw new IllegalStateException("Diffie-Hellman not initialised.");
        } 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            "New message", 
            "Long message for Exception. Long message for Exception. Long message for Exception." }; 
 
    protected Object[] getData() { 
        return new Object[] { new ShortBufferException(), 
                new ShortBufferException(null), new ShortBufferException(msgs[1]) }; 
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        throws ShortBufferException, BadPaddingException 
    { 
 
        if (output.length < getOutputSize(inLen))
        { 
            throw new ShortBufferException("Output buffer too short.");
        } 
        byte[] out = doFinal(input, inOff, inLen);
        System.arraycopy(out, 0, output, outOff, out.length);
        return out.length;
    } 
 
    /** 
     * Compute the output size of an update() or doFinal() operation of a hybrid 
     * asymmetric cipher in encryption mode when given input of the specified 
     * length. 
     * 
     * @param inLen the length of the input 
     * @return the output size 
     */ 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    { 
        byte[] secret = engineGenerateSecret();
 
        if (sharedSecret.length - offset < secret.length)
        { 
            throw new ShortBufferException(kaAlgorithm + " key agreement: need " + secret.length + " bytes");
        } 
 
        System.arraycopy(secret, 0, sharedSecret, offset, secret.length);
         
        return secret.length;
    } 
 
    protected SecretKey engineGenerateSecret(
        String algorithm)
        throws NoSuchAlgorithmException 
    { 
        byte[] secret = bigIntToBytes(result);
 
        // BEGIN android-removed 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            throw new ShortBufferException(Messages.getString("crypto.0E")); //$NON-NLS-1$
        } 
        try { 
            output.put(bOutput);
        } catch (java.nio.BufferOverflowException e) {
            throw new ShortBufferException(Messages.getString("crypto.0F", e)); //$NON-NLS-1$
        } 
        return bOutput.length;
    } 
 
    /*** 
     * Finishes a multi-part transformation (encryption or decryption). 
     * <p> 
     * Processes the {@code inputLen} bytes in {@code input} buffer at {@code 
     * inputOffset}, and any bytes that have been buffered in previous {@code 
     * update} calls. 
     * 
     * @param input 
     *            the input buffer. 
     * @param inputOffset 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    { 
        byte[] secret = engineGenerateSecret();
 
        if (sharedSecret.length - offset < secret.length)
        { 
            throw new ShortBufferException(kaAlgorithm + " key agreement: need " + secret.length + " bytes");
        } 
 
        System.arraycopy(secret, 0, sharedSecret, offset, secret.length);
         
        return secret.length;
    } 
 
    protected SecretKey engineGenerateSecret(
        String algorithm)
        throws NoSuchAlgorithmException 
    { 
        byte[] secret = bigIntToBytes(result);
 
        // BEGIN android-removed 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            "New message", 
            "Long message for Exception. Long message for Exception. Long message for Exception." }; 
 
    protected Object[] getData() { 
        return new Object[] { new ShortBufferException(), 
                new ShortBufferException(null), new ShortBufferException(msgs[1]) }; 
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
      throws ShortBufferException, IllegalBlockSizeException, 
      BadPaddingException 
  { 
    byte[] result = engineDoFinal(EMPTY, 0, 0);
    if (out.length - offset < result.length)
      throw new ShortBufferException("need " + result.length + ", have "
                                     + (out.length - offset));
    System.arraycopy(result, 0, out, offset, result.length);
    return result.length;
  } 
 
  protected int engineDoFinal(final byte[] input, final int offset,
                              final int length, final byte[] output,
                              final int outputOffset)
      throws ShortBufferException, IllegalBlockSizeException, 
      BadPaddingException 
  { 
    byte[] result = engineDoFinal(input, offset, length);
    if (output.length - outputOffset < result.length)
      throw new ShortBufferException("need " + result.length + ", have "
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 ShortBufferException Methods: