本文整理汇总了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);
}