Methods Summary |
---|
public java.util.Map | bDecode(byte[] data)
return( BDecoder.decode( data ));
|
public byte[] | bEncode(java.util.Map map)
return( BEncoder.encode( map ));
|
public byte[] | base32Decode(java.lang.String data)
return( Base32.decode( data ));
|
public java.lang.String | base32Encode(byte[] data)
return( Base32.encode( data ));
|
public byte[] | decodeBytesFromString(java.lang.String str)
return( ByteFormatter.decodeString( str ));
|
public java.lang.String | encodeBytesToString(byte[] bytes)
return( ByteFormatter.encodeString( bytes ));
|
public java.lang.String | formatByteArray(byte[] data, boolean no_spaces)
return( ByteFormatter.nicePrint( data, no_spaces ));
|
public java.lang.String | formatByteCountToKiBEtc(long bytes)
return( DisplayFormatters.formatByteCountToKiBEtc( bytes ));
|
public java.lang.String | formatByteCountToKiBEtcPerSec(long bytes)
return( DisplayFormatters.formatByteCountToKiBEtcPerSec( bytes ));
|
public java.lang.String | formatDate(long millis)
return( DisplayFormatters.formatDate( millis ));
|
public java.lang.String | formatETAFromSeconds(long seconds)
return TimeFormatter.format( seconds );
|
public java.lang.String | formatPercentFromThousands(long thousands)
return( DisplayFormatters.formatPercentFromThousands( (int)thousands ));
|
public java.lang.String | formatTimeFromSeconds(long seconds)
return( DisplayFormatters.formatTime( seconds*1000 ));
|
public java.util.Comparator | getAlphanumericComparator(boolean ignore_case)
return(
new Comparator()
{
public int
compare(
Object o1,
Object o2 )
{
if ( o1 instanceof String &&
o2 instanceof String ){
String s1 = (String)o1;
String s2 = (String)o2;
if ( s1 == null ){
return( -1 );
}
if ( s2 == null ){
return( -1 );
}
int l1 = s1.length();
int l2 = s2.length();
int c1_pos = 0;
int c2_pos = 0;
while( c1_pos < l1 && c2_pos < l2 ){
char c1 = s1.charAt( c1_pos++ );
char c2 = s2.charAt( c2_pos++ );
if ( Character.isDigit(c1) && Character.isDigit(c2)){
int n1_pos = c1_pos-1;
int n2_pos = c2_pos-1;
while( c1_pos < l1 ){
if ( !Character.isDigit( s1.charAt( c1_pos ))){
break;
}
c1_pos++;
}
while(c2_pos<l2){
if ( !Character.isDigit( s2.charAt( c2_pos ))){
break;
}
c2_pos++;
}
int n1_length = c1_pos - n1_pos;
int n2_length = c2_pos - n2_pos;
if ( n1_length != n2_length ){
return( n1_length - n2_length );
}
for (int i=0;i<n1_length;i++){
char nc1 = s1.charAt( n1_pos++ );
char nc2 = s2.charAt( n2_pos++ );
if ( nc1 != nc2 ){
return( nc1 - nc2 );
}
}
}else{
if ( ignore_case ){
c1 = Character.toLowerCase( c1 );
c2 = Character.toLowerCase( c2 );
}
if ( c1 != c2 ){
return( c1 - c2 );
}
}
}
return( l1 - l2);
}else{
return( 0 );
}
}
});
|