Sha256: f890b2084c6b1626bb0fe8b4ca775c924410866d20495a4eefab4834d5dfc3d1
Contents?: true
Size: 519 Bytes
Versions: 6
Compression:
Stored size: 519 Bytes
Contents
package org.sunflow.system; public final class Memory { public static String sizeof(int[] array) { return bytesToString(array == null ? 0 : 4 * array.length); } public static String bytesToString(long bytes) { if (bytes < 1024) { return String.format("%db", bytes); } if (bytes < 1024 * 1024) { return String.format("%dKb", (bytes + 512) >>> 10); } return String.format("%dMb", (bytes + 512 * 1024) >>> 20); } }
Version data entries
6 entries across 6 versions & 1 rubygems