本文整理匯總了Java中java.util.Objects.checkFromIndexSize方法的典型用法代碼示例。如果您正苦於以下問題:Java Objects.checkFromIndexSize方法的具體用法?Java Objects.checkFromIndexSize怎麽用?Java Objects.checkFromIndexSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.Objects
的用法示例。
在下文中一共展示了Objects.checkFromIndexSize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: encryptBlock
import java.util.Objects; //導入方法依賴的package包/類
/**
* Encrypt exactly one block of plaintext.
*/
void encryptBlock(byte[] in, int inOffset,
byte[] out, int outOffset) {
Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length);
Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length);
implEncryptBlock(in, inOffset, out, outOffset);
}
示例2: decryptBlock
import java.util.Objects; //導入方法依賴的package包/類
/**
* Decrypt exactly one block of plaintext.
*/
void decryptBlock(byte[] in, int inOffset,
byte[] out, int outOffset) {
Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length);
Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length);
implDecryptBlock(in, inOffset, out, outOffset);
}
示例3: crypt
import java.util.Objects; //導入方法依賴的package包/類
/**
* Do the actual encryption/decryption operation.
* Essentially we XOR the input plaintext/ciphertext stream with a
* keystream generated by encrypting the counter values. Counter values
* are encrypted on demand.
*/
private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
if (len == 0) {
return 0;
}
Objects.checkFromIndexSize(inOff, len, in.length);
Objects.checkFromIndexSize(outOff, len, out.length);
return implCrypt(in, inOff, len, out, outOff);
}