Android Long Readable Format getSizeDesc(long size)

Here you can find the source of getSizeDesc(long size)

Description

get Size Desc

Declaration

public static String getSizeDesc(long size) 

Method Source Code

//package com.java2s;

public class Main {

    public static String getSizeDesc(long size) {
        String suffix = "B";
        if (size >= 1024) {
            suffix = "K";
            size = size >> 10;//from w  ww . j  av a 2  s.  c om
            if (size >= 1024) {
                suffix = "M";
                //size /= 1024;
                size = size >> 10;
                if (size >= 1024) {
                    suffix = "G";
                    size = size >> 10;
                    //size /= 1024;
                }
            }
        }
        return size + suffix;
    }
}

Related

  1. byteCountToDisplaySize(long size)
  2. humanReadableByteCount(long bytes)
  3. humanReadableByteCount(long bytes, boolean size)
  4. sizeConvert(long size)
  5. prettyBytes(long value)
  6. humanReadableByteCount(long bytes, boolean si)
  7. ReadableByteCount(long bytes)