public final class ParityBit extends Object
ParityBit class is a utility to assist with DES key parity
bit generation.| Constructor and Description |
|---|
ParityBit()
Intended to be package visible.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
set(byte[] bArray,
short bOff,
short bLen,
boolean isEven)
Inserts the computed parity bit of the specified type as the last
bit(LSB) in each of the bytes of the specified byte array.
|
public ParityBit()
public static void set(byte[] bArray,
short bOff,
short bLen,
boolean isEven)
Note:
bOff or bLen
is negative an ArrayIndexOutOfBoundsException exception is thrown.
bLen parameter is equal to 0 no parity bits are inserted.
bOff+bLen is greater than bArray.length, the length
of the bArray array a ArrayIndexOutOfBoundsException exception is thrown
and no parity bits are inserted.
bArray parameter is null
a NullPointerException exception is thrown.bArray - input/output byte arraybOff - offset within byte array to start setting parity onbLen - byte length of input/output bytesisEven - true if even parity is required and false if odd parity is requiredNullPointerException - if bArray is nullArrayIndexOutOfBoundsException - if accessing the input array would cause access of data outside array bounds
or if bLen is negativeCopyright © 1998, 2015, Oracle and/or its affiliates. All rights reserved.