* and get 10111100.  A bit is borrowed from 6th bit(buf[idx]>>6=00000010, tmp>>6=00000011,
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the files COPYING and Copyright.html.  COPYING can be found at the root   *
 * of the source code distribution tree; Copyright.html can be found at the  *
 * root level of an installed copy of the electronic HDF5 document set and   *
 * is linked from the top-level documents page.  It can also be found at     *
 * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html.  If you do not have     *
 * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
 * Module Info: Operations on bit vectors.  A bit vector is an array of bytes
 *      with the least-significant bits in the first byte.  That is,
 *      the bytes are in little-endian order.
 */
#define H5T_PACKAGE     /*suppress error about including H5Tpkg   */
#include "H5private.h"      /*generic functions           */
#include "H5Eprivate.h"     /*error handling              */
#include "H5Iprivate.h"     /*ID functions                */
#include "H5MMprivate.h"    /* Memory management            */
#include "H5Tpkg.h"     /*data-type functions             */
/*-------------------------------------------------------------------------
 * Function:    H5T_bit_copy
 *
 * Purpose: Copies bits from one vector to another.
 *
 * Return:  void
 *
 * Programmer:  Robb Matzke
 *              Wednesday, June 10, 1998
 *
 * Modifications:
 *
 *-------------------------------------------------------------------------
 */
void
H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src,
          size_t src_offset, size_t size)
{
    int shift;
    unsigned    mask_lo, mask_hi;
    int s_idx, d_idx;