should be the same as totalBytes (right?)
173710
protected void tally(WARCRecordType warcRecordType, long contentBytes, long totalBytes, long sizeOnDisk) {
        if (tmpStats == null) {
            tmpStats = new HashMap<String, Map<String,Long>>();
        }

        // add to stats for this record type
        Map<String, Long> substats = tmpStats.get(warcRecordType.toString());
        if (substats == null) {
            substats = new HashMap<String, Long>();
            tmpStats.put(warcRecordType.toString(), substats);
        }
        subtally(substats, contentBytes, totalBytes, sizeOnDisk);
        
        // add to totals
        substats = tmpStats.get(TOTALS);
        if (substats == null) {
            substats = new HashMap<String, Long>();
            tmpStats.put(TOTALS, substats);
        }
        subtally(substats, contentBytes, totalBytes, sizeOnDisk);
    }
1295694
def convert_bytes(bytes):
    
    bytes = float(bytes)
    if bytes >= 1099511627776:
        terabytes = bytes / 1099511627776
        size = '%.2fT' % terabytes
    elif bytes >= 1073741824:
        gigabytes = bytes / 1073741824
        size = '%.2fG' % gigabytes
    elif bytes >= 1048576:
        megabytes = bytes / 1048576
        size = '%.2fM' % megabytes
    elif bytes >= 1024:
        kilobytes = bytes / 1024
        size = '%.2fK' % kilobytes
    else:
        size = '%.2fb' % bytes
    return size
709401
private static String getDumpBytes(WsByteBuffer buffer, int bytesToDump, boolean rewind)
   {
      // Save the current position
      int pos = buffer.position();
      if (rewind)
      {
         buffer.rewind();
      }

      byte[] data = null;
      int start;
      int count = bytesToDump;
      if (count > buffer.remaining() || count == ENTIRE_BUFFER) count = buffer.remaining();

      if (buffer.hasArray())
      {
         data = buffer.array();
         start = buffer.arrayOffset() + buffer.position();
      }
      else
      {
         data = new byte[count];
         buffer.get(data);
         start = 0;
      }

      String strData = "Dumping "+count+" bytes of buffer data:\r\n";
      if (count > 0) strData += SibTr.formatBytes(data, start, count);

      // Return the position to where it should be
      if (rewind) buffer.position(pos);

      return strData;
   }
988683
public static int putBytes(byte[] tgtBytes, int tgtOffset, byte[] srcBytes,
      int srcOffset, int srcLength) {
    System.arraycopy(srcBytes, srcOffset, tgtBytes, tgtOffset, srcLength);
    return tgtOffset + srcLength;
  }
184140
@Override
    public void asBytes(ByteBuffer buf) {
        buf.putInt(VERBOSE_ENCODING);
        buf.putDouble(min);
        buf.putDouble(max);
        buf.putDouble((float) compression());
        buf.putInt(summary.size());
        for (Centroid centroid : summary) {
            buf.putDouble(centroid.mean());
        }

        for (Centroid centroid : summary) {
            buf.putInt(centroid.count());
        }
    }
776623
@Override
    public long getTotalBytes() {
        if (!useLoadBuf) {
            return in.capacity();
        }
        try {
            return channelSize;
        } catch (Exception e) {
            log.error("Error getTotalBytes", e);
            return 0;
        }
    }
246371
def _bytes_to_human(self, B):
        '''  '''
        KB = float(1024)
        MB = float(KB ** 2) # 1,048,576
        GB = float(KB ** 3) # 1,073,741,824
        TB = float(KB ** 4) # 1,099,511,627,776

        if B < KB:
            return '{0} B'.format(B)
        B = float(B)
        if KB <= B < MB:
            return '{0:.2f} KB'.format(B/KB)
        elif MB <= B < GB:
            return '{0:.2f} MB'.format(B/MB)
        elif GB <= B < TB:
            return '{0:.2f} GB'.format(B/GB)
        elif TB <= B:
            return '{0:.2f} TB'.format(B/TB)
501902
private long getRemainingBytes() {
        if (in != null) {
            if (!useLoadBuf) {
                return in.remaining();
            }
            try {
                if (channel.isOpen()) {
                    return channelSize - channel.position() + in.remaining();
                } else {
                    return in.remaining();
                }
            } catch (Exception e) {
                log.error("Error getRemainingBytes", e);
            }
        }
        return 0;
    }
476396
def set_bytes_at_rva(self, rva, data):
        

        if not isinstance(data, bytes):
            raise TypeError('data should be of type: bytes')

        offset = self.get_physical_by_rva(rva)
        if not offset:
            return False

        return self.set_bytes_at_offset(offset, data)
1001791
def auto(self):
        """"""
        if self._value >= 1000000000000:
            return self.tb, 'tb'
        if self._value >= 1000000000:
            return self.gb, 'gb'
        if self._value >= 1000000:
            return self.mb, 'mb'
        if self._value >= 1000:
            return self.kb, 'kb'
        else:
            return self.b, 'b'
435970
void setCurrentBytes(String className, byte[] bytes) {
        ClassInfo ci = get(className);
        ci.setCurrentBytes(bytes);
    }
1000159
public void recordGetTime(long timeNS, boolean emptyResponse, long totalBytes, long keyBytes) {
        recordTime(Tracked.GET, timeNS, emptyResponse ? 1 : 0, totalBytes, keyBytes, 0);
    }
342792
private boolean transfer(long total,
                             GlobusInputStream in,
                             GlobusOutputStream out)
        throws IOException {

        byte [] buffer       = new byte[bufferSize];
        int bytes            = 0;
        long totalBytes      = total;
        long transferedBytes = 0;

        if (total == -1) {
            while( (bytes = in.read(buffer)) != -1) {
                out.write(buffer, 0, bytes);
                out.flush();

                if (listeners != null) {
                    transferedBytes += bytes;
                    fireUrlTransferProgressEvent(totalBytes,
                                                 transferedBytes);
                }
                if (isCanceled()) return false;
            }
        } else {
            while ( total != 0 ) {

                bytes = bufferSize;
                if (total < bufferSize) bytes = (int)total;

                bytes = in.read(buffer);
                out.write(buffer, 0, bytes);
                out.flush();
                total -= bytes;

                if (listeners != null) {
                    transferedBytes += bytes;
                    fireUrlTransferProgressEvent(totalBytes,
                                                 transferedBytes);
                }
                if (isCanceled()) return false;
            }
        }

        return true;
    }
533882
private boolean compareBytes(byte[] lhs, byte[] rhs, int rhsOffset)
   {
      boolean result = true;
      for (int loop = 0; loop < lhs.length; loop++)
      {
         if (lhs[loop] != rhs[rhsOffset + loop])
         {
            result = false;
            break;
         }
      }
      return (result);
   }
1288709
def request_bytesize(self):
        """"""
        return sum(len(str(e)) for elts in self._in_deque for e in elts)
303876
def _backup_bytes(target, offset, length):
    
    click.echo('Backup {l} byes at position {offset} on file {file} to .bytes_backup'.format(
        l=length, offset=offset, file=target))

    with open(target, 'r+b') as f:
        f.seek(offset)

        with open(target + '.bytes_backup', 'w+b') as b:
            for _ in xrange(length):
                byte = f.read(1)
                b.write(byte)
            b.flush()

        f.flush()
371510
def as_bytes(self) -> bytes:
        
        logger = logging.getLogger(__name__)
        logger.debug("BlsEntity.as_bytes: >>> self: %r", self)

        xbytes = POINTER(c_ubyte)()
        xbytes_len = c_size_t()

        do_call(self.as_bytes_handler, self.c_instance, byref(xbytes), byref(xbytes_len))
        res = bytes(xbytes[:xbytes_len.value])

        logger.debug("BlsEntity.as_bytes: <<< res: %r", res)
        return res