Add up the total bytes used by the process.
@param commands
@return
421185
private int getTotalCommandBytes(SubProcessCommandLineArgs commands) {
    int size = 0;
    for (SubProcessCommandLineArgs.Command c : commands.getParameters()) {
      size += c.value.length();
    }
    return size;
  }
85144
protected static String runCommand(String... command) {
		try {
			final Process p = Runtime.getRuntime().exec(command);
			if (p == null) {
				return null;
			}
			final StringBuilder bStr = new StringBuilder();
			try (InputStream standardOutput = p.getInputStream()) {
				final byte[] buffer = new byte[BUFFER_SIZE];
				int len;
				while ((len = standardOutput.read(buffer)) > 0) {
					bStr.append(new String(buffer, 0, len));
				}
				p.waitFor();
				return bStr.toString();
			}
		} catch (Exception e) {
			return null;
		}
	}
1355942
@Override
  public ByteAmount plus(ResourceMeasure<Long> other) {
    checkArgument(Long.MAX_VALUE - value >= other.value,
        String.format("Adding %s to %s would exceed Long.MAX_LONG", other, this));
    return ByteAmount.fromBytes(value + other.value);
  }
855582
public void runPendingCommands() {
        List<Runnable> commandsToRun = commands;
        commands = new ArrayList<Runnable>();
    
        for (Runnable command: commandsToRun) {
            command.run();
        }
    }
295566
public PathBuilder append( String cmd, double... coords )
	{
		s.append( cmd ).append( " " );
		for( double a : coords )
		{
			s.append( a ).append( " " );
		}
		return this;
	}
336598
public void addCommands(Iterable<Command> commands) {
		Assert.notNull(commands, "Commands must not be null");
		for (Command command : commands) {
			addCommand(command);
		}
	}
967886
protected StringBuilder addPart(List<String> commandList,StringBuilder buffer,int endIndex,boolean typeSpace)
    {
        int delta=1;
        if(typeSpace)
        {
            delta=0;
        }
        
        String part=buffer.substring(delta,endIndex);
        commandList.add(part);
        buffer.delete(0,endIndex+delta);

        return buffer;
    }
528371
def copy(self):
        """"""
        ret = super().copy()
        for cmd in self.commands:
            ret.add_command(cmd.copy())
        return ret
1268374
public long getKeyMemoryUsageBytes() {
    long total = 0;
    for (int i = 0; i < maps_.length; i++) {
      if (maps_[i] != null) {
        total += (long) (maps_[i].getActiveEntries()) * keySizeBytes_;
      }
    }
    return total;
  }
662780
private List<String> buildCommand() {
        List<String> command = new ArrayList<String>();
        command.add(cmd);
        command.add("thin");
        command.add("--sourceAppPath=" + getSourceAppPath());
        command.add("--targetLibCachePath=" + getTargetLibCachePath());
        command.add("--targetThinAppPath=" + getTargetThinAppPath());
        if (getParentLibCachePath() != null) {
            command.add("--parentLibCachePath=" + getParentLibCachePath());
        }
        return command;
    }
423634
def sync
      serialized_commands = @commands.map { |c| Protocol.build_command(*c) }
      connection.socket.write(serialized_commands.join)
      Array.new(@commands.size) { connection.read_response }
    ensure
      @commands.clear
    end
144695
public int totalSize() {
        int size = 0;
        for (F first: keySet()) {
            size += getCounter(first).size();
        }

        return size;
    }
42574
protected void safeMulti(CommandOutput<?, ?, ?> output, int count, RedisCommand<?, ?, ?> command) {

        try {
            output.multi(count);
        } catch (Exception e) {
            command.completeExceptionally(e);
        }
    }
83761
private void calculateUploadedAndTotalBytes() {
        uploadedBytes = 0;

        for (String filePath : getSuccessfullyUploadedFiles()) {
            uploadedBytes += new File(filePath).length();
        }

        totalBytes = uploadedBytes;

        for (UploadFile file : params.files) {
            totalBytes += file.length(service);
        }
    }
744305
public byte[] toByteArray() {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream(32);

        outputStream.write(commandByte);

        if (serialize(outputStream)) {
            return outputStream.toByteArray();
        }

        return null;
    }
925717
public java.util.List<Command> getCommands() {
        if (commands == null) {
            commands = new com.amazonaws.internal.SdkInternalList<Command>();
        }
        return commands;
    }
1273280
public ProcessExecutor command(String... command) {
    builder.command(fixArguments(Arrays.asList(command)));
    return this;
  }