Пример #1
0
 /**
  * Bits are expected to be stored in the input byte array from LSB
  *
  * @param byte[] - data to set the input byte
  * @param byte - input byte to be inserted
  * @param startOffset - offset of data[] to start inserting byte from
  * @param numBits - number of bits of input to be inserted into data[]
  * @throws BufferException when the input, startOffset and numBits are not congruent with the data
  *     buffer size
  */
 public static void setByte(byte[] data, byte input, int startOffset, int numBits)
     throws BufferException {
   byte[] inputByteArray = new byte[1];
   Arrays.fill(inputByteArray, 0, 1, input);
   setBytes(data, inputByteArray, startOffset, numBits);
 }