public static String formatByteCountToKiBEtc( long n, boolean rate, boolean bTruncateZeros) { return formatByteCountToKiBEtc(n, rate, bTruncateZeros, -1); }
@Override public String format( int value) { return( DisplayFormatters.formatByteCountToKiBEtc( value )); } };
String getInfo() { return( "merged=" + DisplayFormatters.formatByteCountToKiBEtc( merged_byte_counnt ) + ", ok=" + pieces_completed + ", bad=" + pieces_corrupted + ", force=[" + (forced_end_piece==-1?"":(forced_start_piece + "-" + forced_end_piece)) + "]" ); }
public static String formatByteCountToKiBEtc(int n) { return( formatByteCountToKiBEtc((long)n)); }
public static String formatByteCountToKiBEtcPerSec( long n ) { return( formatByteCountToKiBEtc(n,true,TRUNCZEROS_NO)); }
@Override public String formatByteCountToKiBEtc( long bytes ) { return( DisplayFormatters.formatByteCountToKiBEtc( bytes )); }
@Override public String getString() { return( "speed=" + DisplayFormatters.formatByteCountToKiBEtc( speed )+ ",metric=" + metric_rating + ",segs=" + segs.length + ",hits=" + hits + ",when=" + when ); } }
@Override public String format(int value) { return DisplayFormatters.formatByteCountToKiBEtc(value); } });
protected String formatBytes( long l ) { return( DisplayFormatters.formatByteCountToKiBEtc( l )); }
protected String getString() { return( "lookups=" + lookup_count + ", hits=" + hit_count + ", out=" + packets_out + "/" + DisplayFormatters.formatByteCountToKiBEtc( bytes_out ) + ", in=" + packets_in + "/" + DisplayFormatters.formatByteCountToKiBEtc( bytes_in ) + (last_server_error==null?"":(", error=" + Debug.getNestedExceptionMessage( last_server_error )))); }
protected void report( String resource_key, long bytes ) { if ( progress_listeners.size() > 0 ){ report( resource_key, DisplayFormatters.formatByteCountToKiBEtc( bytes )); } }
protected void checkMaxMessageSize( int size ) throws BuddyPluginException { if ( size > MAX_MESSAGE_SIZE ){ throw( new BuddyPluginException( "Message is too large to send, limit is " + DisplayFormatters.formatByteCountToKiBEtc( MAX_MESSAGE_SIZE ))); } }
@Override public void run(){ mpg.refresh( false ); total_up_down.setText( DisplayFormatters.formatByteCountToKiBEtc( total_sent_received[0] - total_sent_received_initial[0] + total_sent_received_wrapped[0] ) + ", " + DisplayFormatters.formatByteCountToKiBEtc( total_sent_received[1] - total_sent_received_initial[1] + total_sent_received_wrapped[1] )); } };
private void refreshTransportDetails() { DHTTransportStats transportStats = dht.getTransport().getStats(); lblReceivedBytes.setText(DisplayFormatters.formatByteCountToKiBEtc(transportStats.getBytesReceived())); lblSentBytes.setText(DisplayFormatters.formatByteCountToKiBEtc(transportStats.getBytesSent())); lblReceivedPackets.setText("" + transportStats.getPacketsReceived()); lblSentPackets.setText("" + transportStats.getPacketsSent()); }
@Override public void refresh(TableCell cell) { long lRemaining = getRemaining(cell); if( !cell.setSortValue( lRemaining ) && cell.isValid() ) { return; } if (bLastValueEstimate) { cell.setText("~ " + DisplayFormatters.formatByteCountToKiBEtc(lRemaining)); } else { cell.setText(DisplayFormatters.formatByteCountToKiBEtc(lRemaining)); } }
@Override public void refresh(TableCell cell) { SearchSubsResultBase rc = (SearchSubsResultBase) cell.getDataSource(); if (rc == null) { return; } long size = rc.getSize(); if ( size > 0 && cell.setSortValue( size )){ cell.setText( DisplayFormatters.formatByteCountToKiBEtc( size )); } } }
@Override public void refresh(TableCell cell) { TRHostTorrent item = (TRHostTorrent)cell.getDataSource(); long value = (item == null) ? 0 : item.getTotalBytesIn(); if( !cell.setSortValue( value ) && cell.isValid() ) { return; } cell.setText(DisplayFormatters.formatByteCountToKiBEtc(value)); } }
@Override public void refresh(TableCell cell) { PEPeer peer = (PEPeer)cell.getDataSource(); long value = (peer == null) ? 0 : peer.getStats().getTotalDataBytesReceived()-peer.getStats().getTotalDataBytesSent(); if (!cell.setSortValue(value) && cell.isValid()) return; cell.setText((value >= 0 ? "" : "-") + DisplayFormatters.formatByteCountToKiBEtc(Math.abs(value))); } }
@Override public void refresh(TableCell cell) { DownloadManager dm = (DownloadManager)cell.getDataSource(); long value = (dm == null) ? 0 : dm.getStats().getTotalDataBytesSent(); if (!cell.setSortValue(value) && cell.isValid()) return; cell.setText(DisplayFormatters.formatByteCountToKiBEtc(value)); } }
@Override public void refresh(TableCell cell) { PEPeer peer = (PEPeer)cell.getDataSource(); long value = (peer == null) ? 0 : peer.getStats().getTotalBytesDiscarded(); if (!cell.setSortValue(value) && cell.isValid()) return; cell.setText(DisplayFormatters.formatByteCountToKiBEtc(value)); } }