test_class.file: cosmic-common/src/test/java/com/cloud/utils/NumbersUtilTest.java
test_class.identifier: NumbersUtilTest
test_case.body: @Test
      public void toReadableSize() {
          Locale.setDefault(Locale.US); // Fixed locale for the test
          assertEquals("1.0000 TB", NumbersUtil.toReadableSize((1024l * 1024l * 1024l * 1024l)));
          assertEquals("1.00 GB", NumbersUtil.toReadableSize(1024 * 1024 * 1024));
          assertEquals("1.00 MB", NumbersUtil.toReadableSize(1024 * 1024));
          assertEquals("1.00 KB", NumbersUtil.toReadableSize((1024)));
          assertEquals("1023 bytes", NumbersUtil.toReadableSize((1023)));
      }
test_case.class_method_signature: NumbersUtilTest.toReadableSize()
test_case.full_signature: @Test public void toReadableSize()
test_case.identifier: toReadableSize
test_case.invocations: setDefault assertEquals toReadableSize assertEquals toReadableSize assertEquals toReadableSize assertEquals toReadableSize assertEquals toReadableSize
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toReadableSize()
focal_class.declarator: KB = 1024
focal_class.modifier: protected static final
focal_class.original_string: protected static final long KB = 1024;
focal_class.type: long
focal_class.var_name: KB
focal_class.declarator: MB = 1024 * KB
focal_class.modifier: protected static final
focal_class.original_string: protected static final long MB = 1024 * KB;
focal_class.type: long
focal_class.var_name: MB
focal_class.declarator: GB = 1024 * MB
focal_class.modifier: protected static final
focal_class.original_string: protected static final long GB = 1024 * MB;
focal_class.type: long
focal_class.var_name: GB
focal_class.declarator: TB = 1024 * GB
focal_class.modifier: protected static final
focal_class.original_string: protected static final long TB = 1024 * GB;
focal_class.type: long
focal_class.var_name: TB
focal_class.file: cosmic-common/src/main/java/com/cloud/utils/NumbersUtil.java
focal_class.identifier: NumbersUtil
focal_class.class_method_signature: NumbersUtil.parseLong(final String s, final long defaultValue)
focal_class.full_signature: public static long parseLong(final String s, final long defaultValue)
focal_class.identifier: parseLong
focal_class.modifiers: public static
focal_class.parameters: (final String s, final long defaultValue)
focal_class.return: long
focal_class.signature: long parseLong(final String s, final long defaultValue)
focal_class.class_method_signature: NumbersUtil.parseInt(final String s, final int defaultValue)
focal_class.full_signature: public static int parseInt(final String s, final int defaultValue)
focal_class.identifier: parseInt
focal_class.modifiers: public static
focal_class.parameters: (final String s, final int defaultValue)
focal_class.return: int
focal_class.signature: int parseInt(final String s, final int defaultValue)
focal_class.class_method_signature: NumbersUtil.parseFloat(final String s, final float defaultValue)
focal_class.full_signature: public static float parseFloat(final String s, final float defaultValue)
focal_class.identifier: parseFloat
focal_class.modifiers: public static
focal_class.parameters: (final String s, final float defaultValue)
focal_class.return: float
focal_class.signature: float parseFloat(final String s, final float defaultValue)
focal_class.class_method_signature: NumbersUtil.bytesToLong(final byte[] b)
focal_class.full_signature: public static long bytesToLong(final byte[] b)
focal_class.identifier: bytesToLong
focal_class.modifiers: public static
focal_class.parameters: (final byte[] b)
focal_class.return: long
focal_class.signature: long bytesToLong(final byte[] b)
focal_class.class_method_signature: NumbersUtil.bytesToLong(final byte[] b, final int pos)
focal_class.full_signature: public static long bytesToLong(final byte[] b, final int pos)
focal_class.identifier: bytesToLong
focal_class.modifiers: public static
focal_class.parameters: (final byte[] b, final int pos)
focal_class.return: long
focal_class.signature: long bytesToLong(final byte[] b, final int pos)
focal_class.class_method_signature: NumbersUtil.bytesToString(final byte[] data, final int start, int end)
focal_class.full_signature: public static String bytesToString(final byte[] data, final int start, int end)
focal_class.identifier: bytesToString
focal_class.modifiers: public static
focal_class.parameters: (final byte[] data, final int start, int end)
focal_class.return: String
focal_class.signature: String bytesToString(final byte[] data, final int start, int end)
focal_class.class_method_signature: NumbersUtil.toReadableSize(final long bytes)
focal_class.full_signature: public static String toReadableSize(final long bytes)
focal_class.identifier: toReadableSize
focal_class.modifiers: public static
focal_class.parameters: (final long bytes)
focal_class.return: String
focal_class.signature: String toReadableSize(final long bytes)
focal_class.class_method_signature: NumbersUtil.parseInterval(final String str, final long defaultValue)
focal_class.full_signature: public static long parseInterval(final String str, final long defaultValue)
focal_class.identifier: parseInterval
focal_class.modifiers: public static
focal_class.parameters: (final String str, final long defaultValue)
focal_class.return: long
focal_class.signature: long parseInterval(final String str, final long defaultValue)
focal_class.class_method_signature: NumbersUtil.hash(final long value)
focal_class.full_signature: public static int hash(final long value)
focal_class.identifier: hash
focal_class.modifiers: public static
focal_class.parameters: (final long value)
focal_class.return: int
focal_class.signature: int hash(final long value)
focal_method.body: public static String toReadableSize(final long bytes) {
          if (bytes < KB && bytes >= 0) {
              return Long.toString(bytes) + " bytes";
          }
          final StringBuilder builder = new StringBuilder();
          final Formatter format = new Formatter(builder, Locale.getDefault());
          if (bytes < MB) {
              format.format("%.2f KB", (float) bytes / (float) KB);
          } else if (bytes < GB) {
              format.format("%.2f MB", (float) bytes / (float) MB);
          } else if (bytes < TB) {
              format.format("%.2f GB", (float) bytes / (float) GB);
          } else {
              format.format("%.4f TB", (float) bytes / (float) TB);
          }
          format.close();
          return builder.toString();
      }
focal_method.class_method_signature: NumbersUtil.toReadableSize(final long bytes)
focal_method.full_signature: public static String toReadableSize(final long bytes)
focal_method.identifier: toReadableSize
focal_method.invocations: toString getDefault format format format format close toString
focal_method.modifiers: public static
focal_method.parameters: (final long bytes)
focal_method.return: String
focal_method.signature: String toReadableSize(final long bytes)