**javacardx.framework.math** ====Class ParityBit ==== *[[javacard:java-card-api:object|java.lang.Object]] \\ ---- public final class **ParityBit**extends [[javacard:java-card-api:Object|Object]] The ParityBit class is a utility to assist with DES key parity bit generation. **Since:** 2.2.2 ---- ^ Constructor Summary ^^ | **[[javacard:java-card-api:ParityBit#ParityBit()|ParityBit]] **()            |   ^ Method Summary ^^ | **static void** | **[[javacard:java-card-api:ParityBit#set(byte[], short, short, boolean)|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. |   ^ Methods inherited from class java.lang.Object ^ | [[javacard:java-card-api:Object#equals(java.lang.Object)|equals]] |   ^ Constructor Detail ^ === ParityBit === public **ParityBit**() ^ Method Detail ^ === set === public 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. The parity is computed over the first(MS) 7 bits of each byte. The incoming last bit of each byte is ignored. Note: \\ *//If //bOff// or //bLen//is negative an //ArrayIndexOutOfBoundsException// exception is thrown.// \\ *//If //bLen// parameter is equal to 0 no parity bits are inserted.// //// \\ *//////If //bOff+bLen// is greater than //bArray.length//, the length of the //bArray// array a //ArrayIndexOutOfBoundsException// exception is thrown and no parity bits are inserted.// //// \\ *//////If //bArray// parameter is //null// a //NullPointerException// exception is thrown.//**Parameters:** bArray - input/output byte array bOff - offset within byte array to start setting parity on bLen - byte length of input/output bytes isEven - true if even parity is required and false if odd parity is required **Throws:**[[javacard:java-card-api:NullPointerException|NullPointerException]] - if bArray is null [[javacard:java-card-api:ArrayIndexOutOfBoundsException|ArrayIndexOutOfBoundsException]] - if accessing the input array would cause access of data outside array bounds or if bLen is negative //// \\ //// ////