@Override public void render(Object o, int actualWidth, PrintWriter out) { if (o == null) { while (actualWidth-- > 0) { out.append(' '); } } else { long value = (long) o; if (abbrev) { render(value, actualWidth, out); } else { out.format("%" + actualWidth + 'd', value); } } } }
public ColumnWriter bytes(String name) { addColumn(new ByteColumn(name)); return this; }
private void render(long value, int actualWidth, PrintWriter out) { ByteUnit units = DECIMAL.unitsOf(value); String symbol = isoSymbol().of(units); String numerical = render(value, units); int padding = actualWidth - numerical.length() - symbol.length(); while (padding-- > 0) { out.append(' '); } out.append(numerical).append(symbol); }