Codota Logo
StringUtility.getApproximateSize
Code IndexAdd Codota to your IDE (free)

How to use
getApproximateSize
method
in
com.aoindustries.util.StringUtility

Best Java code snippets using com.aoindustries.util.StringUtility.getApproximateSize (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: com.aoindustries/aocode-public

private static void report(String filename, long byteCount, long timespan, long[] bytesRemaining) {
  System.err.print(filename);
  System.err.print(": ");
  System.err.print(byteCount);
  System.err.print(" bytes (");
  System.err.print(StringUtility.getApproximateSize(byteCount));
  System.err.print(") transferred in ");
  System.err.print(BigDecimal.valueOf(timespan, 3));
  System.err.print(" seconds (");
  System.err.print(StringUtility.getTimeLengthString(timespan));
  System.err.print(')');
  if(bytesRemaining!=null && bytesRemaining[0]>0) {
    System.err.print(", ");
    System.err.print(bytesRemaining[0]);
    System.err.print(" bytes (");
    System.err.print(StringUtility.getApproximateSize(bytesRemaining[0]));
    System.err.print(") remaining");
  }
  System.err.println();
  System.err.flush();
}
origin: com.semanticcms/semanticcms-file-model

filename
+ " ("
+ StringUtility.getApproximateSize(resourceFile.length())
+ ')'
origin: com.aoindustries/aocode-public

final File file = new File(filename);
System.out.print("Sequential Read by Block Size (");
System.out.print(StringUtility.getApproximateSize(MAX_READ_BYTES));
System.out.println(" Total)");
for(int ci=0; ci<blockSizes.length; ci++) {
    blockSizeThroughputs.add(throughput);
    System.out.print("    ");
    System.out.print(StringUtility.getApproximateSize(blockSize));
    System.out.print(": ");
    System.out.print(numberFormat.format(throughput));
origin: com.aoindustries/aocode-public

lastVerboseString = TerminalWriter.progressOutput(
  lastVerboseString,
  StringUtility.getApproximateSize(pos+blockSize)
  + ": "
  + SQLUtility.getDecimal((long)block * 10000L / (long)blocks)
  lastVerboseString = TerminalWriter.progressOutput(
    lastVerboseString,
    StringUtility.getApproximateSize(bytesWritten)
    + ": "
    + SQLUtility.getDecimal((long)written * 10000L / (long)numDirtyBlocks)
origin: com.semanticcms/semanticcms-file-servlet

if(!hasBody && resourceFile != null && !isDirectory) {
  out.write(" (");
  encodeTextInXhtml(StringUtility.getApproximateSize(resourceFile.length()), out);
  out.write(')');
com.aoindustries.utilStringUtilitygetApproximateSize

Javadoc

Gets the approximate size (where k=1024) of a file in this format: x byte(s) xx bytes xxx bytes x.x k xx.x k xxx k x.x M xx.x M xxx M x.x G xx.x G xxx G x.x T xx.x T xxx T xxx... T

Popular methods of StringUtility

  • join
    Joins the string representation of objects on the provided delimiter. The iteration will be performe
  • nullIfEmpty
    Returns null if the string is null or empty.
  • splitString
    Splits a String into a String[].
  • splitStringCommaSpace
    Splits a string into multiple words on either whitespace or commas
  • convertToHex
  • getDecimalTimeLengthString
  • replace
    Replaces all occurrences of a String with a String.
  • splitLines
    Splits a String into lines on any '\n' characters. Also removes any ending '\r' characters if presen
  • compareToDDMMYYYY0
  • compareToIgnoreCaseCarefulEquals
    Compares two strings in a case insensitive manner. However, if they are considered equals in the cas
  • convertStringDateToTime
  • countOccurrences
    Counts how many times a word appears in a line. Case insensitive matching.
  • convertStringDateToTime,
  • countOccurrences,
  • getDateString,
  • getHex,
  • getHexChar,
  • getTimeLengthString,
  • indexOf,
  • leapYear,
  • wordWrap

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now