pub fn append_bits(
    buffer_1: &[u8],
    len_1: usize,
    buffer_2: &[u8],
    mut len_2: usize,
) -> (Vec<u8>, usize) {
    /* Check number of bits */
    let max_number_of_bits = buffer_2.len() * BYTE;
    if len_2 > max_number_of_bits {
        len_2 = max_number_of_bits;
    }

    /* Add bits to the end of the buffer */
    let new_buffer = concatinate_bits(&buffer_1, len_1, &buffer_2, len_2);

    (new_buffer, len_1 + len_2)
}
/**
 * Appends the specified number of bits from a bytes array to the binary buffer
 * @param byteArray the byte array with the bits to be appended
 * @param nBits the number of bits to be appended from the byte array
 * @return this binary buffer
 * @throws IllegalStateException if the buffer is marked complete and cannot be altered
 */
Appends the specified number of bits from a bytes array to the binary buffer
@param byteArray the byte array with the bits to be appended
@param nBits the number of bits to be appended from the byte array
@return this binary buffer
@throws IllegalStateException if the buffer is marked complete and cannot be altered
Appends the specified number of bits from a bytes array to the binary buffer @param byteArray the byte array with the bits to be appended @param nBits the number of bits to be appended from the byte array @return this binary buffer @throws IllegalStateException if the buffer is marked complete and cannot be altered
pub fn append_bits(
    buffer_1: &[u8],
    len_1: usize,
    buffer_2: &[u8],
    mut len_2: usize,
) -> (Vec<u8>, usize) {
    /* Check number of bits */
    let max_number_of_bits = buffer_2.len() * BYTE;
    if len_2 > max_number_of_bits {
        len_2 = max_number_of_bits;
    }
    /* Add bits to the end of the buffer */
    let new_buffer = concatinate_bits(&buffer_1, len_1, &buffer_2, len_2);
    (new_buffer, len_1 + len_2)
}
pub fn append_bits ( buffer_1 : & [ u8 ] , len_1 : usize , buffer_2 : & [ u8 ] , mut len_2 : usize , ) -> ( Vec < u8 > , usize ) { /* Check number of bits */ let max_number_of_bits = buffer_2 . len ( ) * BYTE ; if len_2 > max_number_of_bits { len_2 = max_number_of_bits ; } /* Add bits to the end of the buffer */ let new_buffer = concatinate_bits ( & buffer_1 , len_1 , & buffer_2 , len_2 ) ; ( new_buffer , len_1 + len_2 ) }
Appends the specified number of bits from a bytes array to the binary buffer
 @param byteArray the byte array with the bits to be appended
 @param nBits the number of bits to be appended from the byte array
 @return this binary buffer
 @throws IllegalStateException if the buffer is marked complete and cannot be altered
Appends the specified number of bits from a bytes array to the binary buffer @param byteArray the byte array with the bits to be appended @param nBits the number of bits to be appended from the byte array @return this binary buffer @throws IllegalStateException if the buffer is marked complete and cannot be altered
buffer_1
&[u8]
len_1
usize
buffer_2
&[u8]
len_2
usize
buffer_1
&[u8]
len_1
usize
buffer_2
&[u8]
len_2
usize