bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptor.java
int countBits() {
    int total_nbits = 0;
    total_nbytesCDM = 0;

    for (DataDescriptor dd : subKeys) {
      if (dd.subKeys != null) {
        total_nbits += dd.countBits();
        total_nbytesCDM += dd.total_nbytesCDM;

      } else if (dd.f == 0) {
        total_nbits += dd.bitWidth;
        total_nbytesCDM += dd.getByteWidthCDM();
      }
    }

    // replication
    if (replication > 1) {
      total_nbits *= replication;
      total_nbytesCDM *= replication;
    }

    return total_nbits;
  }
int countBits() {
    int total_nbits = 0;
    total_nbytesCDM = 0;

    for (DataDescriptor dd : subKeys) {
      if (dd.subKeys != null) {
        total_nbits += dd.countBits();
        total_nbytesCDM += dd.total_nbytesCDM;

      } else if (dd.f == 0) {
        total_nbits += dd.bitWidth;
        total_nbytesCDM += dd.getByteWidthCDM();
      }
    }

    // replication
    if (replication > 1) {
      total_nbits *= replication;
      total_nbytesCDM *= replication;
    }

    return total_nbits;
  }
int countBits ( ) { int total_nbits = 0 ; total_nbytesCDM = 0 ; for ( DataDescriptor dd : subKeys ) { if ( dd . subKeys != null ) { total_nbits += dd . countBits ( ) ; total_nbytesCDM += dd . total_nbytesCDM ; } else if ( dd . f == 0 ) { total_nbits += dd . bitWidth ; total_nbytesCDM += dd . getByteWidthCDM ( ) ; } } // replication
 if ( replication > 1 ) { total_nbits *= replication ; total_nbytesCDM *= replication ; } return total_nbits ; }
count the bits used by the data in this dd and its children
only accurate for not compressed, and not variable length

@return bits used by the data in the file
count the bits used by the data in this dd and its children only accurate for not compressed and not variable length