2 * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level
3 * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units,
4 * including this file, may be copied, modified, propagated, or distributed except according to the terms contained
7 package de
.xn__ho_hia
.utils
.storage_unit
;
9 import static de
.xn__ho_hia
.quality
.null_analysis
.Nullsafe
.asBigInteger
;
10 import static de
.xn__ho_hia
.quality
.null_analysis
.Nullsafe
.multiplyNullsafe
;
11 import static de
.xn__ho_hia
.quality
.null_analysis
.Nullsafe
.nonNull
;
12 import static de
.xn__ho_hia
.utils
.storage_unit
.FormatUtils
.asFormat
;
13 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_EXABYTE
;
14 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_EXBIBYTE
;
15 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_GIBIBYTE
;
16 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_GIGABYTE
;
17 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_KIBIBYTE
;
18 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_KILOBYTE
;
19 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_MEBIBYTE
;
20 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_MEGABYTE
;
21 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_PEBIBYTE
;
22 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_PETABYTE
;
23 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_TEBIBYTE
;
24 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_TERABYTE
;
25 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_YOBIBYTE
;
26 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_YOTTABYTE
;
27 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_ZEBIBYTE
;
28 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.BYTES_IN_A_ZETTABYTE
;
29 import static de
.xn__ho_hia
.utils
.storage_unit
.StorageUnit
.DEFAULT_FORMAT_PATTERN
;
31 import java
.math
.BigInteger
;
32 import java
.text
.DecimalFormat
;
33 import java
.text
.Format
;
34 import java
.util
.Locale
;
36 import org
.eclipse
.jdt
.annotation
.NonNull
;
39 * Factory for storage units.
41 public final class StorageUnits
{
43 private StorageUnits() {
44 // Hidden constructor.
49 * The amount to bytes to represent.
50 * @return The appropriate binary-prefixed unit for the given amount of bytes.
53 public static StorageUnit
<?
> binaryValueOf(final long bytes
) {
54 return binaryValueOf(asBigInteger(bytes
));
59 * The amount to bytes to represent.
60 * @return The appropriate binary-prefixed unit for the given amount of bytes.
63 public static StorageUnit
<?
> binaryValueOf(@NonNull final BigInteger bytes
) {
64 StorageUnit
<?
> unit
= Byte
.valueOf(bytes
);
66 final BigInteger positiveNumberOfBytes
= bytes
.signum() == -1 ?
nonNull(bytes
.negate()) : bytes
;
68 if (inbetween(BYTES_IN_A_KIBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_MEBIBYTE
)) {
69 unit
= unit
.asKibibyte();
70 } else if (inbetween(BYTES_IN_A_MEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_GIBIBYTE
)) {
71 unit
= unit
.asMebibyte();
72 } else if (inbetween(BYTES_IN_A_GIBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_TEBIBYTE
)) {
73 unit
= unit
.asGibibyte();
74 } else if (inbetween(BYTES_IN_A_TEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_PEBIBYTE
)) {
75 unit
= unit
.asTebibyte();
76 } else if (inbetween(BYTES_IN_A_PEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_EXBIBYTE
)) {
77 unit
= unit
.asPebibyte();
78 } else if (inbetween(BYTES_IN_A_EXBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_ZEBIBYTE
)) {
79 unit
= unit
.asExbibyte();
80 } else if (inbetween(BYTES_IN_A_ZEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_YOBIBYTE
)) {
81 unit
= unit
.asZebibyte();
82 } else if (greaterThanEquals(positiveNumberOfBytes
, BYTES_IN_A_YOBIBYTE
)) {
83 unit
= unit
.asYobibyte();
91 * The amount of bytes to represent.
92 * @return The appropriate metric-prefixed unit for the given amount of bytes.
95 public static StorageUnit
<?
> metricValueOf(final long bytes
) {
96 return metricValueOf(asBigInteger(bytes
));
101 * The amount of bytes to represent.
102 * @return The appropriate metric-prefixed unit for the given amount of bytes.
105 public static StorageUnit
<?
> metricValueOf(@NonNull final BigInteger bytes
) {
106 StorageUnit
<?
> unit
= Byte
.valueOf(bytes
);
108 final BigInteger positiveNumberOfBytes
= bytes
.signum() == -1 ?
nonNull(bytes
.negate()) : bytes
;
110 if (inbetween(BYTES_IN_A_KILOBYTE
, positiveNumberOfBytes
, BYTES_IN_A_MEGABYTE
)) {
111 unit
= unit
.asKilobyte();
112 } else if (inbetween(BYTES_IN_A_MEGABYTE
, positiveNumberOfBytes
, BYTES_IN_A_GIGABYTE
)) {
113 unit
= unit
.asMegabyte();
114 } else if (inbetween(BYTES_IN_A_GIGABYTE
, positiveNumberOfBytes
, BYTES_IN_A_TERABYTE
)) {
115 unit
= unit
.asGigabyte();
116 } else if (inbetween(BYTES_IN_A_TERABYTE
, positiveNumberOfBytes
, BYTES_IN_A_PETABYTE
)) {
117 unit
= unit
.asTerabyte();
118 } else if (inbetween(BYTES_IN_A_PETABYTE
, positiveNumberOfBytes
, BYTES_IN_A_EXABYTE
)) {
119 unit
= unit
.asPetabyte();
120 } else if (inbetween(BYTES_IN_A_EXABYTE
, positiveNumberOfBytes
, BYTES_IN_A_ZETTABYTE
)) {
121 unit
= unit
.asExabyte();
122 } else if (inbetween(BYTES_IN_A_ZETTABYTE
, positiveNumberOfBytes
, BYTES_IN_A_YOTTABYTE
)) {
123 unit
= unit
.asZettabyte();
124 } else if (greaterThanEquals(positiveNumberOfBytes
, BYTES_IN_A_YOTTABYTE
)) {
125 unit
= unit
.asYottabyte();
133 * The amount to bytes to represent.
134 * @return The appropriate common unit for the given amount of bytes.
137 public static StorageUnit
<?
> commonValueOf(final long bytes
) {
138 return commonValueOf(asBigInteger(bytes
));
143 * The amount to bytes to represent.
144 * @return The appropriate common unit for the given amount of bytes.
147 public static StorageUnit
<?
> commonValueOf(@NonNull final BigInteger bytes
) {
148 StorageUnit
<?
> unit
= Byte
.valueOf(bytes
);
150 final BigInteger positiveNumberOfBytes
= bytes
.signum() == -1 ?
nonNull(bytes
.negate()) : bytes
;
152 if (inbetween(BYTES_IN_A_KIBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_MEBIBYTE
)) {
153 unit
= unit
.asCommonKilobyte();
154 } else if (inbetween(BYTES_IN_A_MEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_GIBIBYTE
)) {
155 unit
= unit
.asCommonMegabyte();
156 } else if (inbetween(BYTES_IN_A_GIBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_TEBIBYTE
)) {
157 unit
= unit
.asCommonGigabyte();
158 } else if (inbetween(BYTES_IN_A_TEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_PEBIBYTE
)) {
159 unit
= unit
.asCommonTerabyte();
160 } else if (inbetween(BYTES_IN_A_PEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_EXBIBYTE
)) {
161 unit
= unit
.asCommonPetabyte();
162 } else if (inbetween(BYTES_IN_A_EXBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_ZEBIBYTE
)) {
163 unit
= unit
.asCommonExabyte();
164 } else if (inbetween(BYTES_IN_A_ZEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_YOBIBYTE
)) {
165 unit
= unit
.asCommonZettabyte();
166 } else if (greaterThanEquals(positiveNumberOfBytes
, BYTES_IN_A_YOBIBYTE
)) {
167 unit
= unit
.asCommonYottabyte();
173 private static boolean inbetween(final BigInteger start
, final BigInteger value
, final BigInteger endExclusive
) {
174 return greaterThanEquals(value
, start
) && value
.compareTo(endExclusive
) < 0;
177 private static boolean greaterThanEquals(final BigInteger value
, final BigInteger comparison
) {
178 return value
.compareTo(comparison
) >= 0;
182 * @param numberOfBytes
183 * The amount of bytes to format.
184 * @return The formatted bytes using the default pattern.
187 public static String
formatAsByte(@NonNull final Long numberOfBytes
) {
188 return formatAsByte(numberOfBytes
.longValue());
192 * @param numberOfBytes
193 * The amount of bytes to format.
194 * @return The formatted bytes using the default pattern.
197 public static String
formatAsByte(final long numberOfBytes
) {
198 return formatAsByte(asBigInteger(numberOfBytes
));
202 * @param numberOfBytes
203 * The amount of bytes to format.
204 * @return The formatted bytes using the default pattern.
207 public static String
formatAsByte(@NonNull final BigInteger numberOfBytes
) {
208 return numberOfBytes
.toString() + " B"; //$NON-NLS-1$
212 * @param numberOfBytes
213 * The amount of bytes to format.
214 * @return The formatted bytes using the default pattern.
217 public static String
formatAsBinaryUnit(@NonNull final Long numberOfBytes
) {
218 return formatAsBinaryUnit(numberOfBytes
.longValue());
222 * @param numberOfBytes
223 * The amount of bytes to format.
224 * @return The formatted bytes using the default pattern.
227 public static String
formatAsBinaryUnit(final long numberOfBytes
) {
228 return formatAsBinaryUnit(asBigInteger(numberOfBytes
));
232 * @param numberOfBytes
233 * The amount of bytes to format.
234 * @return The formatted bytes using the default pattern.
237 public static String
formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes
) {
238 return formatAsBinaryUnit(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
242 * @param numberOfBytes
243 * The amount of bytes to format.
245 * The formatting pattern to apply.
246 * @return The formatted bytes using the default pattern.
249 public static String
formatAsBinaryUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
250 return formatAsBinaryUnit(numberOfBytes
.longValue(), pattern
);
254 * @param numberOfBytes
255 * The amount of bytes to format.
257 * The formatting pattern to apply.
258 * @return The formatted bytes using the default pattern.
261 public static String
formatAsBinaryUnit(final long numberOfBytes
, @NonNull final String pattern
) {
262 return formatAsBinaryUnit(asBigInteger(numberOfBytes
), pattern
);
266 * @param numberOfBytes
267 * The amount of bytes to format.
269 * The formatting pattern to apply.
270 * @return The formatted bytes using the default pattern.
273 public static String
formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
274 return formatAsBinaryUnit(numberOfBytes
, new DecimalFormat(pattern
));
278 * @param numberOfBytes
279 * The amount of bytes to format.
281 * The formatting pattern to apply.
284 * @return The formatted bytes using the default pattern.
287 public static String
formatAsBinaryUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
288 @NonNull final Locale locale
) {
289 return formatAsBinaryUnit(numberOfBytes
.longValue(), pattern
, locale
);
293 * @param numberOfBytes
294 * The amount of bytes to format.
296 * The formatting pattern to apply.
299 * @return The formatted bytes using the default pattern.
302 public static String
formatAsBinaryUnit(final long numberOfBytes
, @NonNull final String pattern
,
303 @NonNull final Locale locale
) {
304 return formatAsBinaryUnit(asBigInteger(numberOfBytes
), pattern
, locale
);
308 * @param numberOfBytes
309 * The amount of bytes to format.
311 * The formatting pattern to apply.
314 * @return The formatted bytes using the default pattern.
317 public static String
formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
318 @NonNull final Locale locale
) {
319 return formatAsBinaryUnit(numberOfBytes
, asFormat(pattern
, locale
));
323 * @param numberOfBytes
324 * The amount of bytes to format.
326 * The formatting pattern to apply.
327 * @return The formatted bytes using the default pattern.
330 public static String
formatAsBinaryUnit(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
331 return formatAsBinaryUnit(numberOfBytes
.longValue(), format
);
335 * @param numberOfBytes
336 * The amount of bytes to format.
338 * The formatting pattern to apply.
339 * @return The formatted bytes using the default pattern.
342 public static String
formatAsBinaryUnit(final long numberOfBytes
, @NonNull final Format format
) {
343 return formatAsBinaryUnit(asBigInteger(numberOfBytes
), format
);
347 * @param numberOfBytes
348 * The amount of bytes to format.
350 * The formatting pattern to apply.
351 * @return The formatted bytes using the default pattern.
354 public static String
formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
355 return binaryValueOf(numberOfBytes
).toString(format
);
359 * @param numberOfBytes
360 * The amount of bytes to format.
361 * @return The formatted bytes using the default pattern.
364 public static String
formatAsKibibyte(@NonNull final Long numberOfBytes
) {
365 return formatAsKibibyte(numberOfBytes
.longValue());
369 * @param numberOfBytes
370 * The amount of bytes to format.
371 * @return The formatted bytes using the default pattern.
374 public static String
formatAsKibibyte(final long numberOfBytes
) {
375 return formatAsKibibyte(asBigInteger(numberOfBytes
));
379 * @param numberOfBytes
380 * The amount of bytes to format.
381 * @return The formatted bytes using the default pattern.
384 public static String
formatAsKibibyte(@NonNull final BigInteger numberOfBytes
) {
385 return formatAsKibibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
389 * @param numberOfBytes
390 * The amount of bytes to format.
392 * The formatting pattern to apply.
393 * @return The formatted bytes using the default pattern.
396 public static String
formatAsKibibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
397 return formatAsKibibyte(numberOfBytes
.longValue(), pattern
);
401 * @param numberOfBytes
402 * The amount of bytes to format.
404 * The formatting pattern to apply.
405 * @return The formatted bytes using the default pattern.
408 public static String
formatAsKibibyte(final long numberOfBytes
, @NonNull final String pattern
) {
409 return formatAsKibibyte(asBigInteger(numberOfBytes
), pattern
);
413 * @param numberOfBytes
414 * The amount of bytes to format.
416 * The formatting pattern to apply.
417 * @return The formatted bytes using the default pattern.
420 public static String
formatAsKibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
421 return formatAsKibibyte(numberOfBytes
, new DecimalFormat(pattern
));
425 * @param numberOfBytes
426 * The amount of bytes to format.
428 * The formatting pattern to apply.
431 * @return The formatted bytes using the default pattern.
434 public static String
formatAsKibibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
435 @NonNull final Locale locale
) {
436 return formatAsKibibyte(numberOfBytes
.longValue(), pattern
, locale
);
440 * @param numberOfBytes
441 * The amount of bytes to format.
443 * The formatting pattern to apply.
446 * @return The formatted bytes using the default pattern.
449 public static String
formatAsKibibyte(final long numberOfBytes
, @NonNull final String pattern
,
450 @NonNull final Locale locale
) {
451 return formatAsKibibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
455 * @param numberOfBytes
456 * The amount of bytes to format.
458 * The formatting pattern to apply.
461 * @return The formatted bytes using the default pattern.
464 public static String
formatAsKibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
465 @NonNull final Locale locale
) {
466 return formatAsKibibyte(numberOfBytes
, asFormat(pattern
, locale
));
470 * @param numberOfBytes
471 * The amount of bytes to format.
473 * The formatting pattern to apply.
474 * @return The formatted bytes using the default pattern.
477 public static String
formatAsKibibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
478 return formatAsKibibyte(numberOfBytes
.longValue(), format
);
482 * @param numberOfBytes
483 * The amount of bytes to format.
485 * The formatting pattern to apply.
486 * @return The formatted bytes using the default pattern.
489 public static String
formatAsKibibyte(final long numberOfBytes
, @NonNull final Format format
) {
490 return formatAsKibibyte(asBigInteger(numberOfBytes
), format
);
494 * @param numberOfBytes
495 * The amount of bytes to format.
497 * The formatting pattern to apply.
498 * @return The formatted bytes using the default pattern.
501 public static String
formatAsKibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
502 return Kibibyte
.valueOf(numberOfBytes
).toString(format
);
506 * @param numberOfBytes
507 * The amount of bytes to format.
508 * @return The formatted bytes using the default pattern.
511 public static String
formatAsMebibyte(@NonNull final Long numberOfBytes
) {
512 return formatAsMebibyte(numberOfBytes
.longValue());
516 * @param numberOfBytes
517 * The amount of bytes to format.
518 * @return The formatted bytes using the default pattern.
521 public static String
formatAsMebibyte(final long numberOfBytes
) {
522 return formatAsMebibyte(asBigInteger(numberOfBytes
));
526 * @param numberOfBytes
527 * The amount of bytes to format.
528 * @return The formatted bytes using the default pattern.
531 public static String
formatAsMebibyte(@NonNull final BigInteger numberOfBytes
) {
532 return formatAsMebibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
536 * @param numberOfBytes
537 * The amount of bytes to format.
539 * The formatting pattern to apply.
540 * @return The formatted bytes using the default pattern.
543 public static String
formatAsMebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
544 return formatAsMebibyte(numberOfBytes
.longValue(), pattern
);
548 * @param numberOfBytes
549 * The amount of bytes to format.
551 * The formatting pattern to apply.
552 * @return The formatted bytes using the default pattern.
555 public static String
formatAsMebibyte(final long numberOfBytes
, @NonNull final String pattern
) {
556 return formatAsMebibyte(asBigInteger(numberOfBytes
), pattern
);
560 * @param numberOfBytes
561 * The amount of bytes to format.
563 * The formatting pattern to apply.
564 * @return The formatted bytes using the default pattern.
567 public static String
formatAsMebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
568 return formatAsMebibyte(numberOfBytes
, new DecimalFormat(pattern
));
572 * @param numberOfBytes
573 * The amount of bytes to format.
575 * The formatting pattern to apply.
578 * @return The formatted bytes using the default pattern.
581 public static String
formatAsMebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
582 @NonNull final Locale locale
) {
583 return formatAsMebibyte(numberOfBytes
.longValue(), pattern
, locale
);
587 * @param numberOfBytes
588 * The amount of bytes to format.
590 * The formatting pattern to apply.
593 * @return The formatted bytes using the default pattern.
596 public static String
formatAsMebibyte(final long numberOfBytes
, @NonNull final String pattern
,
597 @NonNull final Locale locale
) {
598 return formatAsMebibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
602 * @param numberOfBytes
603 * The amount of bytes to format.
605 * The formatting pattern to apply.
608 * @return The formatted bytes using the default pattern.
611 public static String
formatAsMebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
612 @NonNull final Locale locale
) {
613 return formatAsMebibyte(numberOfBytes
, asFormat(pattern
, locale
));
617 * @param numberOfBytes
618 * The amount of bytes to format.
620 * The formatting pattern to apply.
621 * @return The formatted bytes using the default pattern.
624 public static String
formatAsMebibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
625 return formatAsMebibyte(numberOfBytes
.longValue(), format
);
629 * @param numberOfBytes
630 * The amount of bytes to format.
632 * The formatting pattern to apply.
633 * @return The formatted bytes using the default pattern.
636 public static String
formatAsMebibyte(final long numberOfBytes
, @NonNull final Format format
) {
637 return formatAsMebibyte(asBigInteger(numberOfBytes
), format
);
641 * @param numberOfBytes
642 * The amount of bytes to format.
644 * The formatting pattern to apply.
645 * @return The formatted bytes using the default pattern.
648 public static String
formatAsMebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
649 return Mebibyte
.valueOf(numberOfBytes
).toString(format
);
653 * @param numberOfBytes
654 * The amount of bytes to format.
655 * @return The formatted bytes using the default pattern.
658 public static String
formatAsGibibyte(@NonNull final Long numberOfBytes
) {
659 return formatAsGibibyte(numberOfBytes
.longValue());
663 * @param numberOfBytes
664 * The amount of bytes to format.
665 * @return The formatted bytes using the default pattern.
668 public static String
formatAsGibibyte(final long numberOfBytes
) {
669 return formatAsGibibyte(asBigInteger(numberOfBytes
));
673 * @param numberOfBytes
674 * The amount of bytes to format.
675 * @return The formatted bytes using the default pattern.
678 public static String
formatAsGibibyte(@NonNull final BigInteger numberOfBytes
) {
679 return formatAsGibibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
683 * @param numberOfBytes
684 * The amount of bytes to format.
686 * The formatting pattern to apply.
687 * @return The formatted bytes using the default pattern.
690 public static String
formatAsGibibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
691 return formatAsGibibyte(numberOfBytes
.longValue(), pattern
);
695 * @param numberOfBytes
696 * The amount of bytes to format.
698 * The formatting pattern to apply.
699 * @return The formatted bytes using the default pattern.
702 public static String
formatAsGibibyte(final long numberOfBytes
, @NonNull final String pattern
) {
703 return formatAsGibibyte(asBigInteger(numberOfBytes
), pattern
);
707 * @param numberOfBytes
708 * The amount of bytes to format.
710 * The formatting pattern to apply.
711 * @return The formatted bytes using the default pattern.
714 public static String
formatAsGibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
715 return formatAsGibibyte(numberOfBytes
, new DecimalFormat(pattern
));
719 * @param numberOfBytes
720 * The amount of bytes to format.
722 * The formatting pattern to apply.
725 * @return The formatted bytes using the default pattern.
728 public static String
formatAsGibibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
729 @NonNull final Locale locale
) {
730 return formatAsGibibyte(numberOfBytes
.longValue(), pattern
, locale
);
734 * @param numberOfBytes
735 * The amount of bytes to format.
737 * The formatting pattern to apply.
740 * @return The formatted bytes using the default pattern.
743 public static String
formatAsGibibyte(final long numberOfBytes
, @NonNull final String pattern
,
744 @NonNull final Locale locale
) {
745 return formatAsGibibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
749 * @param numberOfBytes
750 * The amount of bytes to format.
752 * The formatting pattern to apply.
755 * @return The formatted bytes using the default pattern.
758 public static String
formatAsGibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
759 @NonNull final Locale locale
) {
760 return formatAsGibibyte(numberOfBytes
, asFormat(pattern
, locale
));
764 * @param numberOfBytes
765 * The amount of bytes to format.
767 * The formatting pattern to apply.
768 * @return The formatted bytes using the default pattern.
771 public static String
formatAsGibibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
772 return formatAsGibibyte(numberOfBytes
.longValue(), format
);
776 * @param numberOfBytes
777 * The amount of bytes to format.
779 * The formatting pattern to apply.
780 * @return The formatted bytes using the default pattern.
783 public static String
formatAsGibibyte(final long numberOfBytes
, @NonNull final Format format
) {
784 return formatAsGibibyte(asBigInteger(numberOfBytes
), format
);
788 * @param numberOfBytes
789 * The amount of bytes to format.
791 * The formatting pattern to apply.
792 * @return The formatted bytes using the default pattern.
795 public static String
formatAsGibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
796 return Gibibyte
.valueOf(numberOfBytes
).toString(format
);
800 * @param numberOfBytes
801 * The amount of bytes to format.
802 * @return The formatted bytes using the default pattern.
805 public static String
formatAsTebibyte(@NonNull final Long numberOfBytes
) {
806 return formatAsTebibyte(numberOfBytes
.longValue());
810 * @param numberOfBytes
811 * The amount of bytes to format.
812 * @return The formatted bytes using the default pattern.
815 public static String
formatAsTebibyte(final long numberOfBytes
) {
816 return formatAsTebibyte(asBigInteger(numberOfBytes
));
820 * @param numberOfBytes
821 * The amount of bytes to format.
822 * @return The formatted bytes using the default pattern.
825 public static String
formatAsTebibyte(@NonNull final BigInteger numberOfBytes
) {
826 return formatAsTebibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
830 * @param numberOfBytes
831 * The amount of bytes to format.
833 * The formatting pattern to apply.
834 * @return The formatted bytes using the default pattern.
837 public static String
formatAsTebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
838 return formatAsTebibyte(numberOfBytes
.longValue(), pattern
);
842 * @param numberOfBytes
843 * The amount of bytes to format.
845 * The formatting pattern to apply.
846 * @return The formatted bytes using the default pattern.
849 public static String
formatAsTebibyte(final long numberOfBytes
, @NonNull final String pattern
) {
850 return formatAsTebibyte(asBigInteger(numberOfBytes
), pattern
);
854 * @param numberOfBytes
855 * The amount of bytes to format.
857 * The formatting pattern to apply.
858 * @return The formatted bytes using the default pattern.
861 public static String
formatAsTebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
862 return formatAsTebibyte(numberOfBytes
, new DecimalFormat(pattern
));
866 * @param numberOfBytes
867 * The amount of bytes to format.
869 * The formatting pattern to apply.
872 * @return The formatted bytes using the default pattern.
875 public static String
formatAsTebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
876 @NonNull final Locale locale
) {
877 return formatAsTebibyte(numberOfBytes
.longValue(), pattern
, locale
);
881 * @param numberOfBytes
882 * The amount of bytes to format.
884 * The formatting pattern to apply.
887 * @return The formatted bytes using the default pattern.
890 public static String
formatAsTebibyte(final long numberOfBytes
, @NonNull final String pattern
,
891 @NonNull final Locale locale
) {
892 return formatAsTebibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
896 * @param numberOfBytes
897 * The amount of bytes to format.
899 * The formatting pattern to apply.
902 * @return The formatted bytes using the default pattern.
905 public static String
formatAsTebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
906 @NonNull final Locale locale
) {
907 return formatAsTebibyte(numberOfBytes
, asFormat(pattern
, locale
));
911 * @param numberOfBytes
912 * The amount of bytes to format.
914 * The formatting pattern to apply.
915 * @return The formatted bytes using the default pattern.
918 public static String
formatAsTebibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
919 return formatAsTebibyte(numberOfBytes
.longValue(), format
);
923 * @param numberOfBytes
924 * The amount of bytes to format.
926 * The formatting pattern to apply.
927 * @return The formatted bytes using the default pattern.
930 public static String
formatAsTebibyte(final long numberOfBytes
, @NonNull final Format format
) {
931 return formatAsTebibyte(asBigInteger(numberOfBytes
), format
);
935 * @param numberOfBytes
936 * The amount of bytes to format.
938 * The formatting pattern to apply.
939 * @return The formatted bytes using the default pattern.
942 public static String
formatAsTebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
943 return Tebibyte
.valueOf(numberOfBytes
).toString(format
);
947 * @param numberOfBytes
948 * The amount of bytes to format.
949 * @return The formatted bytes using the default pattern.
952 public static String
formatAsPebibyte(@NonNull final Long numberOfBytes
) {
953 return formatAsPebibyte(numberOfBytes
.longValue());
957 * @param numberOfBytes
958 * The amount of bytes to format.
959 * @return The formatted bytes using the default pattern.
962 public static String
formatAsPebibyte(final long numberOfBytes
) {
963 return formatAsPebibyte(asBigInteger(numberOfBytes
));
967 * @param numberOfBytes
968 * The amount of bytes to format.
969 * @return The formatted bytes using the default pattern.
972 public static String
formatAsPebibyte(@NonNull final BigInteger numberOfBytes
) {
973 return formatAsPebibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
977 * @param numberOfBytes
978 * The amount of bytes to format.
980 * The formatting pattern to apply.
981 * @return The formatted bytes using the default pattern.
984 public static String
formatAsPebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
985 return formatAsPebibyte(numberOfBytes
.longValue(), pattern
);
989 * @param numberOfBytes
990 * The amount of bytes to format.
992 * The formatting pattern to apply.
993 * @return The formatted bytes using the default pattern.
996 public static String
formatAsPebibyte(final long numberOfBytes
, @NonNull final String pattern
) {
997 return formatAsPebibyte(asBigInteger(numberOfBytes
), pattern
);
1001 * @param numberOfBytes
1002 * The amount of bytes to format.
1004 * The formatting pattern to apply.
1005 * @return The formatted bytes using the default pattern.
1008 public static String
formatAsPebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1009 return formatAsPebibyte(numberOfBytes
, new DecimalFormat(pattern
));
1013 * @param numberOfBytes
1014 * The amount of bytes to format.
1016 * The formatting pattern to apply.
1018 * The locale to use.
1019 * @return The formatted bytes using the default pattern.
1022 public static String
formatAsPebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1023 @NonNull final Locale locale
) {
1024 return formatAsPebibyte(numberOfBytes
.longValue(), pattern
, locale
);
1028 * @param numberOfBytes
1029 * The amount of bytes to format.
1031 * The formatting pattern to apply.
1033 * The locale to use.
1034 * @return The formatted bytes using the default pattern.
1037 public static String
formatAsPebibyte(final long numberOfBytes
, @NonNull final String pattern
,
1038 @NonNull final Locale locale
) {
1039 return formatAsPebibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1043 * @param numberOfBytes
1044 * The amount of bytes to format.
1046 * The formatting pattern to apply.
1048 * The locale to use.
1049 * @return The formatted bytes using the default pattern.
1052 public static String
formatAsPebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1053 @NonNull final Locale locale
) {
1054 return formatAsPebibyte(numberOfBytes
, asFormat(pattern
, locale
));
1058 * @param numberOfBytes
1059 * The amount of bytes to format.
1061 * The formatting pattern to apply.
1062 * @return The formatted bytes using the default pattern.
1065 public static String
formatAsPebibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1066 return formatAsPebibyte(numberOfBytes
.longValue(), format
);
1070 * @param numberOfBytes
1071 * The amount of bytes to format.
1073 * The formatting pattern to apply.
1074 * @return The formatted bytes using the default pattern.
1077 public static String
formatAsPebibyte(final long numberOfBytes
, @NonNull final Format format
) {
1078 return formatAsPebibyte(asBigInteger(numberOfBytes
), format
);
1082 * @param numberOfBytes
1083 * The amount of bytes to format.
1085 * The formatting pattern to apply.
1086 * @return The formatted bytes using the default pattern.
1089 public static String
formatAsPebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1090 return Pebibyte
.valueOf(numberOfBytes
).toString(format
);
1094 * @param numberOfBytes
1095 * The amount of bytes to format.
1096 * @return The formatted bytes using the default pattern.
1099 public static String
formatAsExbibyte(@NonNull final Long numberOfBytes
) {
1100 return formatAsExbibyte(numberOfBytes
.longValue());
1104 * @param numberOfBytes
1105 * The amount of bytes to format.
1106 * @return The formatted bytes using the default pattern.
1109 public static String
formatAsExbibyte(final long numberOfBytes
) {
1110 return formatAsExbibyte(asBigInteger(numberOfBytes
));
1114 * @param numberOfBytes
1115 * The amount of bytes to format.
1116 * @return The formatted bytes using the default pattern.
1119 public static String
formatAsExbibyte(@NonNull final BigInteger numberOfBytes
) {
1120 return formatAsExbibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1124 * @param numberOfBytes
1125 * The amount of bytes to format.
1127 * The formatting pattern to apply.
1128 * @return The formatted bytes using the default pattern.
1131 public static String
formatAsExbibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1132 return formatAsExbibyte(numberOfBytes
.longValue(), pattern
);
1136 * @param numberOfBytes
1137 * The amount of bytes to format.
1139 * The formatting pattern to apply.
1140 * @return The formatted bytes using the default pattern.
1143 public static String
formatAsExbibyte(final long numberOfBytes
, @NonNull final String pattern
) {
1144 return formatAsExbibyte(asBigInteger(numberOfBytes
), pattern
);
1148 * @param numberOfBytes
1149 * The amount of bytes to format.
1151 * The formatting pattern to apply.
1152 * @return The formatted bytes using the default pattern.
1155 public static String
formatAsExbibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1156 return formatAsExbibyte(numberOfBytes
, new DecimalFormat(pattern
));
1160 * @param numberOfBytes
1161 * The amount of bytes to format.
1163 * The formatting pattern to apply.
1165 * The locale to use.
1166 * @return The formatted bytes using the default pattern.
1169 public static String
formatAsExbibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1170 @NonNull final Locale locale
) {
1171 return formatAsExbibyte(numberOfBytes
.longValue(), pattern
, locale
);
1175 * @param numberOfBytes
1176 * The amount of bytes to format.
1178 * The formatting pattern to apply.
1180 * The locale to use.
1181 * @return The formatted bytes using the default pattern.
1184 public static String
formatAsExbibyte(final long numberOfBytes
, @NonNull final String pattern
,
1185 @NonNull final Locale locale
) {
1186 return formatAsExbibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1190 * @param numberOfBytes
1191 * The amount of bytes to format.
1193 * The formatting pattern to apply.
1195 * The locale to use.
1196 * @return The formatted bytes using the default pattern.
1199 public static String
formatAsExbibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1200 @NonNull final Locale locale
) {
1201 return formatAsExbibyte(numberOfBytes
, asFormat(pattern
, locale
));
1205 * @param numberOfBytes
1206 * The amount of bytes to format.
1208 * The formatting pattern to apply.
1209 * @return The formatted bytes using the default pattern.
1212 public static String
formatAsExbibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1213 return formatAsExbibyte(numberOfBytes
.longValue(), format
);
1217 * @param numberOfBytes
1218 * The amount of bytes to format.
1220 * The formatting pattern to apply.
1221 * @return The formatted bytes using the default pattern.
1224 public static String
formatAsExbibyte(final long numberOfBytes
, @NonNull final Format format
) {
1225 return formatAsExbibyte(asBigInteger(numberOfBytes
), format
);
1229 * @param numberOfBytes
1230 * The amount of bytes to format.
1232 * The formatting pattern to apply.
1233 * @return The formatted bytes using the default pattern.
1236 public static String
formatAsExbibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1237 return Exbibyte
.valueOf(numberOfBytes
).toString(format
);
1241 * @param numberOfBytes
1242 * The amount of bytes to format.
1243 * @return The formatted bytes using the default pattern.
1246 public static String
formatAsZebibyte(@NonNull final Long numberOfBytes
) {
1247 return formatAsZebibyte(numberOfBytes
.longValue());
1251 * @param numberOfBytes
1252 * The amount of bytes to format.
1253 * @return The formatted bytes using the default pattern.
1256 public static String
formatAsZebibyte(final long numberOfBytes
) {
1257 return formatAsZebibyte(asBigInteger(numberOfBytes
));
1261 * @param numberOfBytes
1262 * The amount of bytes to format.
1263 * @return The formatted bytes using the default pattern.
1266 public static String
formatAsZebibyte(@NonNull final BigInteger numberOfBytes
) {
1267 return formatAsZebibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1271 * @param numberOfBytes
1272 * The amount of bytes to format.
1274 * The formatting pattern to apply.
1275 * @return The formatted bytes using the default pattern.
1278 public static String
formatAsZebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1279 return formatAsZebibyte(numberOfBytes
.longValue(), pattern
);
1283 * @param numberOfBytes
1284 * The amount of bytes to format.
1286 * The formatting pattern to apply.
1287 * @return The formatted bytes using the default pattern.
1290 public static String
formatAsZebibyte(final long numberOfBytes
, @NonNull final String pattern
) {
1291 return formatAsZebibyte(asBigInteger(numberOfBytes
), pattern
);
1295 * @param numberOfBytes
1296 * The amount of bytes to format.
1298 * The formatting pattern to apply.
1299 * @return The formatted bytes using the default pattern.
1302 public static String
formatAsZebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1303 return formatAsZebibyte(numberOfBytes
, new DecimalFormat(pattern
));
1307 * @param numberOfBytes
1308 * The amount of bytes to format.
1310 * The formatting pattern to apply.
1312 * The locale to use.
1313 * @return The formatted bytes using the default pattern.
1316 public static String
formatAsZebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1317 @NonNull final Locale locale
) {
1318 return formatAsZebibyte(numberOfBytes
.longValue(), pattern
, locale
);
1322 * @param numberOfBytes
1323 * The amount of bytes to format.
1325 * The formatting pattern to apply.
1327 * The locale to use.
1328 * @return The formatted bytes using the default pattern.
1331 public static String
formatAsZebibyte(final long numberOfBytes
, @NonNull final String pattern
,
1332 @NonNull final Locale locale
) {
1333 return formatAsZebibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1337 * @param numberOfBytes
1338 * The amount of bytes to format.
1340 * The formatting pattern to apply.
1342 * The locale to use.
1343 * @return The formatted bytes using the default pattern.
1346 public static String
formatAsZebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1347 @NonNull final Locale locale
) {
1348 return formatAsZebibyte(numberOfBytes
, asFormat(pattern
, locale
));
1352 * @param numberOfBytes
1353 * The amount of bytes to format.
1355 * The formatting pattern to apply.
1356 * @return The formatted bytes using the default pattern.
1359 public static String
formatAsZebibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1360 return formatAsZebibyte(numberOfBytes
.longValue(), format
);
1364 * @param numberOfBytes
1365 * The amount of bytes to format.
1367 * The formatting pattern to apply.
1368 * @return The formatted bytes using the default pattern.
1371 public static String
formatAsZebibyte(final long numberOfBytes
, @NonNull final Format format
) {
1372 return formatAsZebibyte(asBigInteger(numberOfBytes
), format
);
1376 * @param numberOfBytes
1377 * The amount of bytes to format.
1379 * The formatting pattern to apply.
1380 * @return The formatted bytes using the default pattern.
1383 public static String
formatAsZebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1384 return Zebibyte
.valueOf(numberOfBytes
).toString(format
);
1388 * @param numberOfBytes
1389 * The amount of bytes to format.
1390 * @return The formatted bytes using the default pattern.
1393 public static String
formatAsYobibyte(@NonNull final Long numberOfBytes
) {
1394 return formatAsYobibyte(numberOfBytes
.longValue());
1398 * @param numberOfBytes
1399 * The amount of bytes to format.
1400 * @return The formatted bytes using the default pattern.
1403 public static String
formatAsYobibyte(final long numberOfBytes
) {
1404 return formatAsYobibyte(asBigInteger(numberOfBytes
));
1408 * @param numberOfBytes
1409 * The amount of bytes to format.
1410 * @return The formatted bytes using the default pattern.
1413 public static String
formatAsYobibyte(@NonNull final BigInteger numberOfBytes
) {
1414 return formatAsYobibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1418 * @param numberOfBytes
1419 * The amount of bytes to format.
1421 * The formatting pattern to apply.
1422 * @return The formatted bytes using the default pattern.
1425 public static String
formatAsYobibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1426 return formatAsYobibyte(numberOfBytes
.longValue(), pattern
);
1430 * @param numberOfBytes
1431 * The amount of bytes to format.
1433 * The formatting pattern to apply.
1434 * @return The formatted bytes using the default pattern.
1437 public static String
formatAsYobibyte(final long numberOfBytes
, @NonNull final String pattern
) {
1438 return formatAsYobibyte(asBigInteger(numberOfBytes
), pattern
);
1442 * @param numberOfBytes
1443 * The amount of bytes to format.
1445 * The formatting pattern to apply.
1446 * @return The formatted bytes using the default pattern.
1449 public static String
formatAsYobibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1450 return formatAsYobibyte(numberOfBytes
, new DecimalFormat(pattern
));
1454 * @param numberOfBytes
1455 * The amount of bytes to format.
1457 * The formatting pattern to apply.
1459 * The locale to use.
1460 * @return The formatted bytes using the default pattern.
1463 public static String
formatAsYobibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1464 @NonNull final Locale locale
) {
1465 return formatAsYobibyte(numberOfBytes
.longValue(), pattern
, locale
);
1469 * @param numberOfBytes
1470 * The amount of bytes to format.
1472 * The formatting pattern to apply.
1474 * The locale to use.
1475 * @return The formatted bytes using the default pattern.
1478 public static String
formatAsYobibyte(final long numberOfBytes
, @NonNull final String pattern
,
1479 @NonNull final Locale locale
) {
1480 return formatAsYobibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1484 * @param numberOfBytes
1485 * The amount of bytes to format.
1487 * The formatting pattern to apply.
1489 * The locale to use.
1490 * @return The formatted bytes using the default pattern.
1493 public static String
formatAsYobibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1494 @NonNull final Locale locale
) {
1495 return formatAsYobibyte(numberOfBytes
, asFormat(pattern
, locale
));
1499 * @param numberOfBytes
1500 * The amount of bytes to format.
1502 * The formatting pattern to apply.
1503 * @return The formatted bytes using the default pattern.
1506 public static String
formatAsYobibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1507 return formatAsYobibyte(numberOfBytes
.longValue(), format
);
1511 * @param numberOfBytes
1512 * The amount of bytes to format.
1514 * The formatting pattern to apply.
1515 * @return The formatted bytes using the default pattern.
1518 public static String
formatAsYobibyte(final long numberOfBytes
, @NonNull final Format format
) {
1519 return formatAsYobibyte(asBigInteger(numberOfBytes
), format
);
1523 * @param numberOfBytes
1524 * The amount of bytes to format.
1526 * The formatting pattern to apply.
1527 * @return The formatted bytes using the default pattern.
1530 public static String
formatAsYobibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1531 return Yobibyte
.valueOf(numberOfBytes
).toString(format
);
1535 * @param numberOfBytes
1536 * The amount of bytes to format.
1537 * @return The formatted bytes using the default pattern.
1540 public static String
formatAsMetricUnit(@NonNull final Long numberOfBytes
) {
1541 return formatAsMetricUnit(numberOfBytes
.longValue());
1545 * @param numberOfBytes
1546 * The amount of bytes to format.
1547 * @return The formatted bytes using the default pattern.
1550 public static String
formatAsMetricUnit(final long numberOfBytes
) {
1551 return formatAsMetricUnit(asBigInteger(numberOfBytes
));
1555 * @param numberOfBytes
1556 * The amount of bytes to format.
1557 * @return The formatted bytes using the default pattern.
1560 public static String
formatAsMetricUnit(@NonNull final BigInteger numberOfBytes
) {
1561 return formatAsMetricUnit(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1565 * @param numberOfBytes
1566 * The amount of bytes to format.
1568 * The formatting pattern to apply.
1569 * @return The formatted bytes using the default pattern.
1572 public static String
formatAsMetricUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1573 return formatAsMetricUnit(numberOfBytes
.longValue(), pattern
);
1577 * @param numberOfBytes
1578 * The amount of bytes to format.
1580 * The formatting pattern to apply.
1581 * @return The formatted bytes using the default pattern.
1584 public static String
formatAsMetricUnit(final long numberOfBytes
, @NonNull final String pattern
) {
1585 return formatAsMetricUnit(asBigInteger(numberOfBytes
), pattern
);
1589 * @param numberOfBytes
1590 * The amount of bytes to format.
1592 * The formatting pattern to apply.
1593 * @return The formatted bytes using the default pattern.
1596 public static String
formatAsMetricUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1597 return formatAsMetricUnit(numberOfBytes
, new DecimalFormat(pattern
));
1601 * @param numberOfBytes
1602 * The amount of bytes to format.
1604 * The formatting pattern to apply.
1606 * The locale to use.
1607 * @return The formatted bytes using the default pattern.
1610 public static String
formatAsMetricUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1611 @NonNull final Locale locale
) {
1612 return formatAsMetricUnit(numberOfBytes
.longValue(), pattern
, locale
);
1616 * @param numberOfBytes
1617 * The amount of bytes to format.
1619 * The formatting pattern to apply.
1621 * The locale to use.
1622 * @return The formatted bytes using the default pattern.
1625 public static String
formatAsMetricUnit(final long numberOfBytes
, @NonNull final String pattern
,
1626 @NonNull final Locale locale
) {
1627 return formatAsMetricUnit(asBigInteger(numberOfBytes
), pattern
, locale
);
1631 * @param numberOfBytes
1632 * The amount of bytes to format.
1634 * The formatting pattern to apply.
1636 * The locale to use.
1637 * @return The formatted bytes using the default pattern.
1640 public static String
formatAsMetricUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1641 @NonNull final Locale locale
) {
1642 return formatAsMetricUnit(numberOfBytes
, asFormat(pattern
, locale
));
1646 * @param numberOfBytes
1647 * The amount of bytes to format.
1649 * The formatting pattern to apply.
1650 * @return The formatted bytes using the default pattern.
1653 public static String
formatAsMetricUnit(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1654 return formatAsMetricUnit(numberOfBytes
.longValue(), format
);
1658 * @param numberOfBytes
1659 * The amount of bytes to format.
1661 * The formatting pattern to apply.
1662 * @return The formatted bytes using the default pattern.
1665 public static String
formatAsMetricUnit(final long numberOfBytes
, @NonNull final Format format
) {
1666 return formatAsMetricUnit(asBigInteger(numberOfBytes
), format
);
1670 * @param numberOfBytes
1671 * The amount of bytes to format.
1673 * The formatting pattern to apply.
1674 * @return The formatted bytes using the default pattern.
1677 public static String
formatAsMetricUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1678 return metricValueOf(numberOfBytes
).toString(format
);
1682 * @param numberOfBytes
1683 * The amount of bytes to format.
1684 * @return The formatted bytes using the default pattern.
1687 public static String
formatAsKilobyte(@NonNull final Long numberOfBytes
) {
1688 return formatAsKilobyte(numberOfBytes
.longValue());
1692 * @param numberOfBytes
1693 * The amount of bytes to format.
1694 * @return The formatted bytes using the default pattern.
1697 public static String
formatAsKilobyte(final long numberOfBytes
) {
1698 return formatAsKilobyte(asBigInteger(numberOfBytes
));
1702 * @param numberOfBytes
1703 * The amount of bytes to format.
1704 * @return The formatted bytes using the default pattern.
1707 public static String
formatAsKilobyte(@NonNull final BigInteger numberOfBytes
) {
1708 return formatAsKilobyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1712 * @param numberOfBytes
1713 * The amount of bytes to format.
1715 * The formatting pattern to apply.
1716 * @return The formatted bytes using the default pattern.
1719 public static String
formatAsKilobyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1720 return formatAsKilobyte(numberOfBytes
.longValue(), pattern
);
1724 * @param numberOfBytes
1725 * The amount of bytes to format.
1727 * The formatting pattern to apply.
1728 * @return The formatted bytes using the default pattern.
1731 public static String
formatAsKilobyte(final long numberOfBytes
, @NonNull final String pattern
) {
1732 return formatAsKilobyte(asBigInteger(numberOfBytes
), pattern
);
1736 * @param numberOfBytes
1737 * The amount of bytes to format.
1739 * The formatting pattern to apply.
1740 * @return The formatted bytes using the default pattern.
1743 public static String
formatAsKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1744 return formatAsKilobyte(numberOfBytes
, new DecimalFormat(pattern
));
1748 * @param numberOfBytes
1749 * The amount of bytes to format.
1751 * The formatting pattern to apply.
1753 * The locale to use.
1754 * @return The formatted bytes using the default pattern.
1757 public static String
formatAsKilobyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1758 @NonNull final Locale locale
) {
1759 return formatAsKilobyte(numberOfBytes
.longValue(), pattern
, locale
);
1763 * @param numberOfBytes
1764 * The amount of bytes to format.
1766 * The formatting pattern to apply.
1768 * The locale to use.
1769 * @return The formatted bytes using the default pattern.
1772 public static String
formatAsKilobyte(final long numberOfBytes
, @NonNull final String pattern
,
1773 @NonNull final Locale locale
) {
1774 return formatAsKilobyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1778 * @param numberOfBytes
1779 * The amount of bytes to format.
1781 * The formatting pattern to apply.
1783 * The locale to use.
1784 * @return The formatted bytes using the default pattern.
1787 public static String
formatAsKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1788 @NonNull final Locale locale
) {
1789 return formatAsKilobyte(numberOfBytes
, asFormat(pattern
, locale
));
1793 * @param numberOfBytes
1794 * The amount of bytes to format.
1796 * The formatting pattern to apply.
1797 * @return The formatted bytes using the default pattern.
1800 public static String
formatAsKilobyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1801 return formatAsKilobyte(numberOfBytes
.longValue(), format
);
1805 * @param numberOfBytes
1806 * The amount of bytes to format.
1808 * The formatting pattern to apply.
1809 * @return The formatted bytes using the default pattern.
1812 public static String
formatAsKilobyte(final long numberOfBytes
, @NonNull final Format format
) {
1813 return formatAsKilobyte(asBigInteger(numberOfBytes
), format
);
1817 * @param numberOfBytes
1818 * The amount of bytes to format.
1820 * The formatting pattern to apply.
1821 * @return The formatted bytes using the default pattern.
1824 public static String
formatAsKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1825 return Kilobyte
.valueOf(numberOfBytes
).toString(format
);
1829 * @param numberOfBytes
1830 * The amount of bytes to format.
1831 * @return The formatted bytes using the default pattern.
1834 public static String
formatAsMegabyte(@NonNull final Long numberOfBytes
) {
1835 return formatAsMegabyte(numberOfBytes
.longValue());
1839 * @param numberOfBytes
1840 * The amount of bytes to format.
1841 * @return The formatted bytes using the default pattern.
1844 public static String
formatAsMegabyte(final long numberOfBytes
) {
1845 return formatAsMegabyte(asBigInteger(numberOfBytes
));
1849 * @param numberOfBytes
1850 * The amount of bytes to format.
1851 * @return The formatted bytes using the default pattern.
1854 public static String
formatAsMegabyte(@NonNull final BigInteger numberOfBytes
) {
1855 return formatAsMegabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1859 * @param numberOfBytes
1860 * The amount of bytes to format.
1862 * The formatting pattern to apply.
1863 * @return The formatted bytes using the default pattern.
1866 public static String
formatAsMegabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1867 return formatAsMegabyte(numberOfBytes
.longValue(), pattern
);
1871 * @param numberOfBytes
1872 * The amount of bytes to format.
1874 * The formatting pattern to apply.
1875 * @return The formatted bytes using the default pattern.
1878 public static String
formatAsMegabyte(final long numberOfBytes
, @NonNull final String pattern
) {
1879 return formatAsMegabyte(asBigInteger(numberOfBytes
), pattern
);
1883 * @param numberOfBytes
1884 * The amount of bytes to format.
1886 * The formatting pattern to apply.
1887 * @return The formatted bytes using the default pattern.
1890 public static String
formatAsMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1891 return formatAsMegabyte(numberOfBytes
, new DecimalFormat(pattern
));
1895 * @param numberOfBytes
1896 * The amount of bytes to format.
1898 * The formatting pattern to apply.
1900 * The locale to use.
1901 * @return The formatted bytes using the default pattern.
1904 public static String
formatAsMegabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1905 @NonNull final Locale locale
) {
1906 return formatAsMegabyte(numberOfBytes
.longValue(), pattern
, locale
);
1910 * @param numberOfBytes
1911 * The amount of bytes to format.
1913 * The formatting pattern to apply.
1915 * The locale to use.
1916 * @return The formatted bytes using the default pattern.
1919 public static String
formatAsMegabyte(final long numberOfBytes
, @NonNull final String pattern
,
1920 @NonNull final Locale locale
) {
1921 return formatAsMegabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1925 * @param numberOfBytes
1926 * The amount of bytes to format.
1928 * The formatting pattern to apply.
1930 * The locale to use.
1931 * @return The formatted bytes using the default pattern.
1934 public static String
formatAsMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1935 @NonNull final Locale locale
) {
1936 return formatAsMegabyte(numberOfBytes
, asFormat(pattern
, locale
));
1940 * @param numberOfBytes
1941 * The amount of bytes to format.
1943 * The formatting pattern to apply.
1944 * @return The formatted bytes using the default pattern.
1947 public static String
formatAsMegabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1948 return formatAsMegabyte(numberOfBytes
.longValue(), format
);
1952 * @param numberOfBytes
1953 * The amount of bytes to format.
1955 * The formatting pattern to apply.
1956 * @return The formatted bytes using the default pattern.
1959 public static String
formatAsMegabyte(final long numberOfBytes
, @NonNull final Format format
) {
1960 return formatAsMegabyte(asBigInteger(numberOfBytes
), format
);
1964 * @param numberOfBytes
1965 * The amount of bytes to format.
1967 * The formatting pattern to apply.
1968 * @return The formatted bytes using the default pattern.
1971 public static String
formatAsMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1972 return Megabyte
.valueOf(numberOfBytes
).toString(format
);
1976 * @param numberOfBytes
1977 * The amount of bytes to format.
1978 * @return The formatted bytes using the default pattern.
1981 public static String
formatAsGigabyte(@NonNull final Long numberOfBytes
) {
1982 return formatAsGigabyte(numberOfBytes
.longValue());
1986 * @param numberOfBytes
1987 * The amount of bytes to format.
1988 * @return The formatted bytes using the default pattern.
1991 public static String
formatAsGigabyte(final long numberOfBytes
) {
1992 return formatAsGigabyte(asBigInteger(numberOfBytes
));
1996 * @param numberOfBytes
1997 * The amount of bytes to format.
1998 * @return The formatted bytes using the default pattern.
2001 public static String
formatAsGigabyte(@NonNull final BigInteger numberOfBytes
) {
2002 return formatAsGigabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2006 * @param numberOfBytes
2007 * The amount of bytes to format.
2009 * The formatting pattern to apply.
2010 * @return The formatted bytes using the default pattern.
2013 public static String
formatAsGigabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2014 return formatAsGigabyte(numberOfBytes
.longValue(), pattern
);
2018 * @param numberOfBytes
2019 * The amount of bytes to format.
2021 * The formatting pattern to apply.
2022 * @return The formatted bytes using the default pattern.
2025 public static String
formatAsGigabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2026 return formatAsGigabyte(asBigInteger(numberOfBytes
), pattern
);
2030 * @param numberOfBytes
2031 * The amount of bytes to format.
2033 * The formatting pattern to apply.
2034 * @return The formatted bytes using the default pattern.
2037 public static String
formatAsGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2038 return formatAsGigabyte(numberOfBytes
, new DecimalFormat(pattern
));
2042 * @param numberOfBytes
2043 * The amount of bytes to format.
2045 * The formatting pattern to apply.
2047 * The locale to use.
2048 * @return The formatted bytes using the default pattern.
2051 public static String
formatAsGigabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2052 @NonNull final Locale locale
) {
2053 return formatAsGigabyte(numberOfBytes
.longValue(), pattern
, locale
);
2057 * @param numberOfBytes
2058 * The amount of bytes to format.
2060 * The formatting pattern to apply.
2062 * The locale to use.
2063 * @return The formatted bytes using the default pattern.
2066 public static String
formatAsGigabyte(final long numberOfBytes
, @NonNull final String pattern
,
2067 @NonNull final Locale locale
) {
2068 return formatAsGigabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2072 * @param numberOfBytes
2073 * The amount of bytes to format.
2075 * The formatting pattern to apply.
2077 * The locale to use.
2078 * @return The formatted bytes using the default pattern.
2081 public static String
formatAsGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2082 @NonNull final Locale locale
) {
2083 return formatAsGigabyte(numberOfBytes
, asFormat(pattern
, locale
));
2087 * @param numberOfBytes
2088 * The amount of bytes to format.
2090 * The formatting pattern to apply.
2091 * @return The formatted bytes using the default pattern.
2094 public static String
formatAsGigabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2095 return formatAsGigabyte(numberOfBytes
.longValue(), format
);
2099 * @param numberOfBytes
2100 * The amount of bytes to format.
2102 * The formatting pattern to apply.
2103 * @return The formatted bytes using the default pattern.
2106 public static String
formatAsGigabyte(final long numberOfBytes
, @NonNull final Format format
) {
2107 return formatAsGigabyte(asBigInteger(numberOfBytes
), format
);
2111 * @param numberOfBytes
2112 * The amount of bytes to format.
2114 * The formatting pattern to apply.
2115 * @return The formatted bytes using the default pattern.
2118 public static String
formatAsGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2119 return Gigabyte
.valueOf(numberOfBytes
).toString(format
);
2123 * @param numberOfBytes
2124 * The amount of bytes to format.
2125 * @return The formatted bytes using the default pattern.
2128 public static String
formatAsTerabyte(@NonNull final Long numberOfBytes
) {
2129 return formatAsTerabyte(numberOfBytes
.longValue());
2133 * @param numberOfBytes
2134 * The amount of bytes to format.
2135 * @return The formatted bytes using the default pattern.
2138 public static String
formatAsTerabyte(final long numberOfBytes
) {
2139 return formatAsTerabyte(asBigInteger(numberOfBytes
));
2143 * @param numberOfBytes
2144 * The amount of bytes to format.
2145 * @return The formatted bytes using the default pattern.
2148 public static String
formatAsTerabyte(@NonNull final BigInteger numberOfBytes
) {
2149 return formatAsTerabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2153 * @param numberOfBytes
2154 * The amount of bytes to format.
2156 * The formatting pattern to apply.
2157 * @return The formatted bytes using the default pattern.
2160 public static String
formatAsTerabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2161 return formatAsTerabyte(numberOfBytes
.longValue(), pattern
);
2165 * @param numberOfBytes
2166 * The amount of bytes to format.
2168 * The formatting pattern to apply.
2169 * @return The formatted bytes using the default pattern.
2172 public static String
formatAsTerabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2173 return formatAsTerabyte(asBigInteger(numberOfBytes
), pattern
);
2177 * @param numberOfBytes
2178 * The amount of bytes to format.
2180 * The formatting pattern to apply.
2181 * @return The formatted bytes using the default pattern.
2184 public static String
formatAsTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2185 return formatAsTerabyte(numberOfBytes
, new DecimalFormat(pattern
));
2189 * @param numberOfBytes
2190 * The amount of bytes to format.
2192 * The formatting pattern to apply.
2194 * The locale to use.
2195 * @return The formatted bytes using the default pattern.
2198 public static String
formatAsTerabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2199 @NonNull final Locale locale
) {
2200 return formatAsTerabyte(numberOfBytes
.longValue(), pattern
, locale
);
2204 * @param numberOfBytes
2205 * The amount of bytes to format.
2207 * The formatting pattern to apply.
2209 * The locale to use.
2210 * @return The formatted bytes using the default pattern.
2213 public static String
formatAsTerabyte(final long numberOfBytes
, @NonNull final String pattern
,
2214 @NonNull final Locale locale
) {
2215 return formatAsTerabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2219 * @param numberOfBytes
2220 * The amount of bytes to format.
2222 * The formatting pattern to apply.
2224 * The locale to use.
2225 * @return The formatted bytes using the default pattern.
2228 public static String
formatAsTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2229 @NonNull final Locale locale
) {
2230 return formatAsTerabyte(numberOfBytes
, asFormat(pattern
, locale
));
2234 * @param numberOfBytes
2235 * The amount of bytes to format.
2237 * The formatting pattern to apply.
2238 * @return The formatted bytes using the default pattern.
2241 public static String
formatAsTerabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2242 return formatAsTerabyte(numberOfBytes
.longValue(), format
);
2246 * @param numberOfBytes
2247 * The amount of bytes to format.
2249 * The formatting pattern to apply.
2250 * @return The formatted bytes using the default pattern.
2253 public static String
formatAsTerabyte(final long numberOfBytes
, @NonNull final Format format
) {
2254 return formatAsTerabyte(asBigInteger(numberOfBytes
), format
);
2258 * @param numberOfBytes
2259 * The amount of bytes to format.
2261 * The formatting pattern to apply.
2262 * @return The formatted bytes using the default pattern.
2265 public static String
formatAsTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2266 return Terabyte
.valueOf(numberOfBytes
).toString(format
);
2270 * @param numberOfBytes
2271 * The amount of bytes to format.
2272 * @return The formatted bytes using the default pattern.
2275 public static String
formatAsPetabyte(@NonNull final Long numberOfBytes
) {
2276 return formatAsPetabyte(numberOfBytes
.longValue());
2280 * @param numberOfBytes
2281 * The amount of bytes to format.
2282 * @return The formatted bytes using the default pattern.
2285 public static String
formatAsPetabyte(final long numberOfBytes
) {
2286 return formatAsPetabyte(asBigInteger(numberOfBytes
));
2290 * @param numberOfBytes
2291 * The amount of bytes to format.
2292 * @return The formatted bytes using the default pattern.
2295 public static String
formatAsPetabyte(@NonNull final BigInteger numberOfBytes
) {
2296 return formatAsPetabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2300 * @param numberOfBytes
2301 * The amount of bytes to format.
2303 * The formatting pattern to apply.
2304 * @return The formatted bytes using the default pattern.
2307 public static String
formatAsPetabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2308 return formatAsPetabyte(numberOfBytes
.longValue(), pattern
);
2312 * @param numberOfBytes
2313 * The amount of bytes to format.
2315 * The formatting pattern to apply.
2316 * @return The formatted bytes using the default pattern.
2319 public static String
formatAsPetabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2320 return formatAsPetabyte(asBigInteger(numberOfBytes
), pattern
);
2324 * @param numberOfBytes
2325 * The amount of bytes to format.
2327 * The formatting pattern to apply.
2328 * @return The formatted bytes using the default pattern.
2331 public static String
formatAsPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2332 return formatAsPetabyte(numberOfBytes
, new DecimalFormat(pattern
));
2336 * @param numberOfBytes
2337 * The amount of bytes to format.
2339 * The formatting pattern to apply.
2341 * The locale to use.
2342 * @return The formatted bytes using the default pattern.
2345 public static String
formatAsPetabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2346 @NonNull final Locale locale
) {
2347 return formatAsPetabyte(numberOfBytes
.longValue(), pattern
, locale
);
2351 * @param numberOfBytes
2352 * The amount of bytes to format.
2354 * The formatting pattern to apply.
2356 * The locale to use.
2357 * @return The formatted bytes using the default pattern.
2360 public static String
formatAsPetabyte(final long numberOfBytes
, @NonNull final String pattern
,
2361 @NonNull final Locale locale
) {
2362 return formatAsPetabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2366 * @param numberOfBytes
2367 * The amount of bytes to format.
2369 * The formatting pattern to apply.
2371 * The locale to use.
2372 * @return The formatted bytes using the default pattern.
2375 public static String
formatAsPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2376 @NonNull final Locale locale
) {
2377 return formatAsPetabyte(numberOfBytes
, asFormat(pattern
, locale
));
2381 * @param numberOfBytes
2382 * The amount of bytes to format.
2384 * The formatting pattern to apply.
2385 * @return The formatted bytes using the default pattern.
2388 public static String
formatAsPetabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2389 return formatAsPetabyte(numberOfBytes
.longValue(), format
);
2393 * @param numberOfBytes
2394 * The amount of bytes to format.
2396 * The formatting pattern to apply.
2397 * @return The formatted bytes using the default pattern.
2400 public static String
formatAsPetabyte(final long numberOfBytes
, @NonNull final Format format
) {
2401 return formatAsPetabyte(asBigInteger(numberOfBytes
), format
);
2405 * @param numberOfBytes
2406 * The amount of bytes to format.
2408 * The formatting pattern to apply.
2409 * @return The formatted bytes using the default pattern.
2412 public static String
formatAsPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2413 return Petabyte
.valueOf(numberOfBytes
).toString(format
);
2417 * @param numberOfBytes
2418 * The amount of bytes to format.
2419 * @return The formatted bytes using the default pattern.
2422 public static String
formatAsExabyte(@NonNull final Long numberOfBytes
) {
2423 return formatAsExabyte(numberOfBytes
.longValue());
2427 * @param numberOfBytes
2428 * The amount of bytes to format.
2429 * @return The formatted bytes using the default pattern.
2432 public static String
formatAsExabyte(final long numberOfBytes
) {
2433 return formatAsExabyte(asBigInteger(numberOfBytes
));
2437 * @param numberOfBytes
2438 * The amount of bytes to format.
2439 * @return The formatted bytes using the default pattern.
2442 public static String
formatAsExabyte(@NonNull final BigInteger numberOfBytes
) {
2443 return formatAsExabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2447 * @param numberOfBytes
2448 * The amount of bytes to format.
2450 * The formatting pattern to apply.
2451 * @return The formatted bytes using the default pattern.
2454 public static String
formatAsExabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2455 return formatAsExabyte(numberOfBytes
.longValue(), pattern
);
2459 * @param numberOfBytes
2460 * The amount of bytes to format.
2462 * The formatting pattern to apply.
2463 * @return The formatted bytes using the default pattern.
2466 public static String
formatAsExabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2467 return formatAsExabyte(asBigInteger(numberOfBytes
), pattern
);
2471 * @param numberOfBytes
2472 * The amount of bytes to format.
2474 * The formatting pattern to apply.
2475 * @return The formatted bytes using the default pattern.
2478 public static String
formatAsExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2479 return formatAsExabyte(numberOfBytes
, new DecimalFormat(pattern
));
2483 * @param numberOfBytes
2484 * The amount of bytes to format.
2486 * The formatting pattern to apply.
2488 * The locale to use.
2489 * @return The formatted bytes using the default pattern.
2492 public static String
formatAsExabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2493 @NonNull final Locale locale
) {
2494 return formatAsExabyte(numberOfBytes
.longValue(), pattern
, locale
);
2498 * @param numberOfBytes
2499 * The amount of bytes to format.
2501 * The formatting pattern to apply.
2503 * The locale to use.
2504 * @return The formatted bytes using the default pattern.
2507 public static String
formatAsExabyte(final long numberOfBytes
, @NonNull final String pattern
,
2508 @NonNull final Locale locale
) {
2509 return formatAsExabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2513 * @param numberOfBytes
2514 * The amount of bytes to format.
2516 * The formatting pattern to apply.
2518 * The locale to use.
2519 * @return The formatted bytes using the default pattern.
2522 public static String
formatAsExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2523 @NonNull final Locale locale
) {
2524 return formatAsExabyte(numberOfBytes
, asFormat(pattern
, locale
));
2528 * @param numberOfBytes
2529 * The amount of bytes to format.
2531 * The formatting pattern to apply.
2532 * @return The formatted bytes using the default pattern.
2535 public static String
formatAsExabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2536 return formatAsExabyte(numberOfBytes
.longValue(), format
);
2540 * @param numberOfBytes
2541 * The amount of bytes to format.
2543 * The formatting pattern to apply.
2544 * @return The formatted bytes using the default pattern.
2547 public static String
formatAsExabyte(final long numberOfBytes
, @NonNull final Format format
) {
2548 return formatAsExabyte(asBigInteger(numberOfBytes
), format
);
2552 * @param numberOfBytes
2553 * The amount of bytes to format.
2555 * The formatting pattern to apply.
2556 * @return The formatted bytes using the default pattern.
2559 public static String
formatAsExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2560 return Exabyte
.valueOf(numberOfBytes
).toString(format
);
2564 * @param numberOfBytes
2565 * The amount of bytes to format.
2566 * @return The formatted bytes using the default pattern.
2569 public static String
formatAsZettabyte(@NonNull final Long numberOfBytes
) {
2570 return formatAsZettabyte(numberOfBytes
.longValue());
2574 * @param numberOfBytes
2575 * The amount of bytes to format.
2576 * @return The formatted bytes using the default pattern.
2579 public static String
formatAsZettabyte(final long numberOfBytes
) {
2580 return formatAsZettabyte(asBigInteger(numberOfBytes
));
2584 * @param numberOfBytes
2585 * The amount of bytes to format.
2586 * @return The formatted bytes using the default pattern.
2589 public static String
formatAsZettabyte(@NonNull final BigInteger numberOfBytes
) {
2590 return formatAsZettabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2594 * @param numberOfBytes
2595 * The amount of bytes to format.
2597 * The formatting pattern to apply.
2598 * @return The formatted bytes using the default pattern.
2601 public static String
formatAsZettabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2602 return formatAsZettabyte(numberOfBytes
.longValue(), pattern
);
2606 * @param numberOfBytes
2607 * The amount of bytes to format.
2609 * The formatting pattern to apply.
2610 * @return The formatted bytes using the default pattern.
2613 public static String
formatAsZettabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2614 return formatAsZettabyte(asBigInteger(numberOfBytes
), pattern
);
2618 * @param numberOfBytes
2619 * The amount of bytes to format.
2621 * The formatting pattern to apply.
2622 * @return The formatted bytes using the default pattern.
2625 public static String
formatAsZettabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2626 return formatAsZettabyte(numberOfBytes
, new DecimalFormat(pattern
));
2630 * @param numberOfBytes
2631 * The amount of bytes to format.
2633 * The formatting pattern to apply.
2635 * The locale to use.
2636 * @return The formatted bytes using the default pattern.
2639 public static String
formatAsZettabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2640 @NonNull final Locale locale
) {
2641 return formatAsZettabyte(numberOfBytes
.longValue(), pattern
, locale
);
2645 * @param numberOfBytes
2646 * The amount of bytes to format.
2648 * The formatting pattern to apply.
2650 * The locale to use.
2651 * @return The formatted bytes using the default pattern.
2654 public static String
formatAsZettabyte(final long numberOfBytes
, @NonNull final String pattern
,
2655 @NonNull final Locale locale
) {
2656 return formatAsZettabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2660 * @param numberOfBytes
2661 * The amount of bytes to format.
2663 * The formatting pattern to apply.
2665 * The locale to use.
2666 * @return The formatted bytes using the default pattern.
2669 public static String
formatAsZettabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2670 @NonNull final Locale locale
) {
2671 return formatAsZettabyte(numberOfBytes
, asFormat(pattern
, locale
));
2675 * @param numberOfBytes
2676 * The amount of bytes to format.
2678 * The formatting pattern to apply.
2679 * @return The formatted bytes using the default pattern.
2682 public static String
formatAsZettabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2683 return formatAsZettabyte(numberOfBytes
.longValue(), format
);
2687 * @param numberOfBytes
2688 * The amount of bytes to format.
2690 * The formatting pattern to apply.
2691 * @return The formatted bytes using the default pattern.
2694 public static String
formatAsZettabyte(final long numberOfBytes
, @NonNull final Format format
) {
2695 return formatAsZettabyte(asBigInteger(numberOfBytes
), format
);
2699 * @param numberOfBytes
2700 * The amount of bytes to format.
2702 * The formatting pattern to apply.
2703 * @return The formatted bytes using the default pattern.
2706 public static String
formatAsZettabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2707 return Zettabyte
.valueOf(numberOfBytes
).toString(format
);
2711 * @param numberOfBytes
2712 * The amount of bytes to format.
2713 * @return The formatted bytes using the default pattern.
2716 public static String
formatAsYottabyte(@NonNull final Long numberOfBytes
) {
2717 return formatAsYottabyte(numberOfBytes
.longValue());
2721 * @param numberOfBytes
2722 * The amount of bytes to format.
2723 * @return The formatted bytes using the default pattern.
2726 public static String
formatAsYottabyte(final long numberOfBytes
) {
2727 return formatAsYottabyte(asBigInteger(numberOfBytes
));
2731 * @param numberOfBytes
2732 * The amount of bytes to format.
2733 * @return The formatted bytes using the default pattern.
2736 public static String
formatAsYottabyte(@NonNull final BigInteger numberOfBytes
) {
2737 return formatAsYottabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2741 * @param numberOfBytes
2742 * The amount of bytes to format.
2744 * The formatting pattern to apply.
2745 * @return The formatted bytes using the default pattern.
2748 public static String
formatAsYottabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2749 return formatAsYottabyte(numberOfBytes
.longValue(), pattern
);
2753 * @param numberOfBytes
2754 * The amount of bytes to format.
2756 * The formatting pattern to apply.
2757 * @return The formatted bytes using the default pattern.
2760 public static String
formatAsYottabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2761 return formatAsYottabyte(asBigInteger(numberOfBytes
), pattern
);
2765 * @param numberOfBytes
2766 * The amount of bytes to format.
2768 * The formatting pattern to apply.
2770 * The locale to use.
2771 * @return The formatted bytes using the default pattern.
2774 public static String
formatAsYottabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2775 @NonNull final Locale locale
) {
2776 return formatAsYottabyte(numberOfBytes
, asFormat(pattern
, locale
));
2780 * @param numberOfBytes
2781 * The amount of bytes to format.
2783 * The formatting pattern to apply.
2785 * The locale to use.
2786 * @return The formatted bytes using the default pattern.
2789 public static String
formatAsYottabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2790 @NonNull final Locale locale
) {
2791 return formatAsYottabyte(numberOfBytes
.longValue(), pattern
, locale
);
2795 * @param numberOfBytes
2796 * The amount of bytes to format.
2798 * The formatting pattern to apply.
2800 * The locale to use.
2801 * @return The formatted bytes using the default pattern.
2804 public static String
formatAsYottabyte(final long numberOfBytes
, @NonNull final String pattern
,
2805 @NonNull final Locale locale
) {
2806 return formatAsYottabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2810 * @param numberOfBytes
2811 * The amount of bytes to format.
2813 * The formatting pattern to apply.
2814 * @return The formatted bytes using the default pattern.
2817 public static String
formatAsYottabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2818 return formatAsYottabyte(numberOfBytes
, new DecimalFormat(pattern
));
2822 * @param numberOfBytes
2823 * The amount of bytes to format.
2825 * The formatting pattern to apply.
2826 * @return The formatted bytes using the default pattern.
2829 public static String
formatAsYottabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2830 return formatAsYottabyte(numberOfBytes
.longValue(), format
);
2834 * @param numberOfBytes
2835 * The amount of bytes to format.
2837 * The formatting pattern to apply.
2838 * @return The formatted bytes using the default pattern.
2841 public static String
formatAsYottabyte(final long numberOfBytes
, @NonNull final Format format
) {
2842 return formatAsYottabyte(asBigInteger(numberOfBytes
), format
);
2846 * @param numberOfBytes
2847 * The amount of bytes to format.
2849 * The formatting pattern to apply.
2850 * @return The formatted bytes using the default pattern.
2853 public static String
formatAsYottabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2854 return Yottabyte
.valueOf(numberOfBytes
).toString(format
);
2858 * @param numberOfBytes
2859 * The amount of bytes to format.
2860 * @return The formatted bytes using the default pattern.
2863 public static String
formatAsCommonUnit(@NonNull final Long numberOfBytes
) {
2864 return formatAsCommonUnit(numberOfBytes
.longValue());
2868 * @param numberOfBytes
2869 * The amount of bytes to format.
2870 * @return The formatted bytes using the default pattern.
2873 public static String
formatAsCommonUnit(final long numberOfBytes
) {
2874 return formatAsCommonUnit(asBigInteger(numberOfBytes
));
2878 * @param numberOfBytes
2879 * The amount of bytes to format.
2880 * @return The formatted bytes using the default pattern.
2883 public static String
formatAsCommonUnit(@NonNull final BigInteger numberOfBytes
) {
2884 return formatAsCommonUnit(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2888 * @param numberOfBytes
2889 * The amount of bytes to format.
2891 * The formatting pattern to apply.
2892 * @return The formatted bytes using the default pattern.
2895 public static String
formatAsCommonUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2896 return formatAsCommonUnit(numberOfBytes
.longValue(), pattern
);
2900 * @param numberOfBytes
2901 * The amount of bytes to format.
2903 * The formatting pattern to apply.
2904 * @return The formatted bytes using the default pattern.
2907 public static String
formatAsCommonUnit(final long numberOfBytes
, @NonNull final String pattern
) {
2908 return formatAsCommonUnit(asBigInteger(numberOfBytes
), pattern
);
2912 * @param numberOfBytes
2913 * The amount of bytes to format.
2915 * The formatting pattern to apply.
2916 * @return The formatted bytes using the default pattern.
2919 public static String
formatAsCommonUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2920 return formatAsCommonUnit(numberOfBytes
, new DecimalFormat(pattern
));
2924 * @param numberOfBytes
2925 * The amount of bytes to format.
2927 * The formatting pattern to apply.
2929 * The locale to use.
2930 * @return The formatted bytes using the default pattern.
2933 public static String
formatAsCommonUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2934 @NonNull final Locale locale
) {
2935 return formatAsCommonUnit(numberOfBytes
.longValue(), pattern
, locale
);
2939 * @param numberOfBytes
2940 * The amount of bytes to format.
2942 * The formatting pattern to apply.
2944 * The locale to use.
2945 * @return The formatted bytes using the default pattern.
2948 public static String
formatAsCommonUnit(final long numberOfBytes
, @NonNull final String pattern
,
2949 @NonNull final Locale locale
) {
2950 return formatAsCommonUnit(asBigInteger(numberOfBytes
), pattern
, locale
);
2954 * @param numberOfBytes
2955 * The amount of bytes to format.
2957 * The formatting pattern to apply.
2959 * The locale to use.
2960 * @return The formatted bytes using the default pattern.
2963 public static String
formatAsCommonUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2964 @NonNull final Locale locale
) {
2965 return formatAsCommonUnit(numberOfBytes
, asFormat(pattern
, locale
));
2969 * @param numberOfBytes
2970 * The amount of bytes to format.
2972 * The formatting pattern to apply.
2973 * @return The formatted bytes using the default pattern.
2976 public static String
formatAsCommonUnit(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2977 return formatAsCommonUnit(numberOfBytes
.longValue(), format
);
2981 * @param numberOfBytes
2982 * The amount of bytes to format.
2984 * The formatting pattern to apply.
2985 * @return The formatted bytes using the default pattern.
2988 public static String
formatAsCommonUnit(final long numberOfBytes
, @NonNull final Format format
) {
2989 return formatAsCommonUnit(asBigInteger(numberOfBytes
), format
);
2993 * @param numberOfBytes
2994 * The amount of bytes to format.
2996 * The formatting pattern to apply.
2997 * @return The formatted bytes using the default pattern.
3000 public static String
formatAsCommonUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3001 return commonValueOf(numberOfBytes
).toString(format
);
3005 * @param numberOfBytes
3006 * The amount of bytes to format.
3007 * @return The formatted bytes using the default pattern.
3010 public static String
formatAsCommonKilobyte(@NonNull final Long numberOfBytes
) {
3011 return formatAsCommonKilobyte(numberOfBytes
.longValue());
3015 * @param numberOfBytes
3016 * The amount of bytes to format.
3017 * @return The formatted bytes using the default pattern.
3020 public static String
formatAsCommonKilobyte(final long numberOfBytes
) {
3021 return formatAsCommonKilobyte(asBigInteger(numberOfBytes
));
3025 * @param numberOfBytes
3026 * The amount of bytes to format.
3027 * @return The formatted bytes using the default pattern.
3030 public static String
formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes
) {
3031 return formatAsCommonKilobyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3035 * @param numberOfBytes
3036 * The amount of bytes to format.
3038 * The formatting pattern to apply.
3039 * @return The formatted bytes using the default pattern.
3042 public static String
formatAsCommonKilobyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3043 return formatAsCommonKilobyte(numberOfBytes
.longValue(), pattern
);
3047 * @param numberOfBytes
3048 * The amount of bytes to format.
3050 * The formatting pattern to apply.
3051 * @return The formatted bytes using the default pattern.
3054 public static String
formatAsCommonKilobyte(final long numberOfBytes
, @NonNull final String pattern
) {
3055 return formatAsCommonKilobyte(asBigInteger(numberOfBytes
), pattern
);
3059 * @param numberOfBytes
3060 * The amount of bytes to format.
3062 * The formatting pattern to apply.
3063 * @return The formatted bytes using the default pattern.
3066 public static String
formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes
,
3067 @NonNull final String pattern
) {
3068 return formatAsCommonKilobyte(numberOfBytes
, new DecimalFormat(pattern
));
3072 * @param numberOfBytes
3073 * The amount of bytes to format.
3075 * The formatting pattern to apply.
3077 * The locale to use.
3078 * @return The formatted bytes using the default pattern.
3081 public static String
formatAsCommonKilobyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3082 @NonNull final Locale locale
) {
3083 return formatAsCommonKilobyte(numberOfBytes
.longValue(), pattern
, locale
);
3087 * @param numberOfBytes
3088 * The amount of bytes to format.
3090 * The formatting pattern to apply.
3092 * The locale to use.
3093 * @return The formatted bytes using the default pattern.
3096 public static String
formatAsCommonKilobyte(final long numberOfBytes
, @NonNull final String pattern
,
3097 @NonNull final Locale locale
) {
3098 return formatAsCommonKilobyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3102 * @param numberOfBytes
3103 * The amount of bytes to format.
3105 * The formatting pattern to apply.
3107 * The locale to use.
3108 * @return The formatted bytes using the default pattern.
3111 public static String
formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3112 @NonNull final Locale locale
) {
3113 return formatAsCommonKilobyte(numberOfBytes
, asFormat(pattern
, locale
));
3117 * @param numberOfBytes
3118 * The amount of bytes to format.
3120 * The formatting pattern to apply.
3121 * @return The formatted bytes using the default pattern.
3124 public static String
formatAsCommonKilobyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3125 return formatAsCommonKilobyte(numberOfBytes
.longValue(), format
);
3129 * @param numberOfBytes
3130 * The amount of bytes to format.
3132 * The formatting pattern to apply.
3133 * @return The formatted bytes using the default pattern.
3136 public static String
formatAsCommonKilobyte(final long numberOfBytes
, @NonNull final Format format
) {
3137 return formatAsCommonKilobyte(asBigInteger(numberOfBytes
), format
);
3141 * @param numberOfBytes
3142 * The amount of bytes to format.
3144 * The formatting pattern to apply.
3145 * @return The formatted bytes using the default pattern.
3148 public static String
formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3149 return CommonKilobyte
.valueOf(numberOfBytes
).toString(format
);
3153 * @param numberOfBytes
3154 * The amount of bytes to format.
3155 * @return The formatted bytes using the default pattern.
3158 public static String
formatAsCommonMegabyte(@NonNull final Long numberOfBytes
) {
3159 return formatAsCommonMegabyte(numberOfBytes
.longValue());
3163 * @param numberOfBytes
3164 * The amount of bytes to format.
3165 * @return The formatted bytes using the default pattern.
3168 public static String
formatAsCommonMegabyte(final long numberOfBytes
) {
3169 return formatAsCommonMegabyte(asBigInteger(numberOfBytes
));
3173 * @param numberOfBytes
3174 * The amount of bytes to format.
3175 * @return The formatted bytes using the default pattern.
3178 public static String
formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes
) {
3179 return formatAsCommonMegabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3183 * @param numberOfBytes
3184 * The amount of bytes to format.
3186 * The formatting pattern to apply.
3187 * @return The formatted bytes using the default pattern.
3190 public static String
formatAsCommonMegabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3191 return formatAsCommonMegabyte(numberOfBytes
.longValue(), pattern
);
3195 * @param numberOfBytes
3196 * The amount of bytes to format.
3198 * The formatting pattern to apply.
3199 * @return The formatted bytes using the default pattern.
3202 public static String
formatAsCommonMegabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3203 return formatAsCommonMegabyte(asBigInteger(numberOfBytes
), pattern
);
3207 * @param numberOfBytes
3208 * The amount of bytes to format.
3210 * The formatting pattern to apply.
3211 * @return The formatted bytes using the default pattern.
3214 public static String
formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes
,
3215 @NonNull final String pattern
) {
3216 return formatAsCommonMegabyte(numberOfBytes
, new DecimalFormat(pattern
));
3220 * @param numberOfBytes
3221 * The amount of bytes to format.
3223 * The formatting pattern to apply.
3225 * The locale to use.
3226 * @return The formatted bytes using the default pattern.
3229 public static String
formatAsCommonMegabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3230 @NonNull final Locale locale
) {
3231 return formatAsCommonMegabyte(numberOfBytes
.longValue(), pattern
, locale
);
3235 * @param numberOfBytes
3236 * The amount of bytes to format.
3238 * The formatting pattern to apply.
3240 * The locale to use.
3241 * @return The formatted bytes using the default pattern.
3244 public static String
formatAsCommonMegabyte(final long numberOfBytes
, @NonNull final String pattern
,
3245 @NonNull final Locale locale
) {
3246 return formatAsCommonMegabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3250 * @param numberOfBytes
3251 * The amount of bytes to format.
3253 * The formatting pattern to apply.
3255 * The locale to use.
3256 * @return The formatted bytes using the default pattern.
3259 public static String
formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3260 @NonNull final Locale locale
) {
3261 return formatAsCommonMegabyte(numberOfBytes
, asFormat(pattern
, locale
));
3265 * @param numberOfBytes
3266 * The amount of bytes to format.
3268 * The formatting pattern to apply.
3269 * @return The formatted bytes using the default pattern.
3272 public static String
formatAsCommonMegabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3273 return formatAsCommonMegabyte(numberOfBytes
.longValue(), format
);
3277 * @param numberOfBytes
3278 * The amount of bytes to format.
3280 * The formatting pattern to apply.
3281 * @return The formatted bytes using the default pattern.
3284 public static String
formatAsCommonMegabyte(final long numberOfBytes
, @NonNull final Format format
) {
3285 return formatAsCommonMegabyte(asBigInteger(numberOfBytes
), format
);
3289 * @param numberOfBytes
3290 * The amount of bytes to format.
3292 * The formatting pattern to apply.
3293 * @return The formatted bytes using the default pattern.
3296 public static String
formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3297 return CommonMegabyte
.valueOf(numberOfBytes
).toString(format
);
3301 * @param numberOfBytes
3302 * The amount of bytes to format.
3303 * @return The formatted bytes using the default pattern.
3306 public static String
formatAsCommonGigabyte(@NonNull final Long numberOfBytes
) {
3307 return formatAsCommonGigabyte(numberOfBytes
.longValue());
3311 * @param numberOfBytes
3312 * The amount of bytes to format.
3313 * @return The formatted bytes using the default pattern.
3316 public static String
formatAsCommonGigabyte(final long numberOfBytes
) {
3317 return formatAsCommonGigabyte(asBigInteger(numberOfBytes
));
3321 * @param numberOfBytes
3322 * The amount of bytes to format.
3323 * @return The formatted bytes using the default pattern.
3326 public static String
formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes
) {
3327 return formatAsCommonGigabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3331 * @param numberOfBytes
3332 * The amount of bytes to format.
3334 * The formatting pattern to apply.
3335 * @return The formatted bytes using the default pattern.
3338 public static String
formatAsCommonGigabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3339 return formatAsCommonGigabyte(numberOfBytes
.longValue(), pattern
);
3343 * @param numberOfBytes
3344 * The amount of bytes to format.
3346 * The formatting pattern to apply.
3347 * @return The formatted bytes using the default pattern.
3350 public static String
formatAsCommonGigabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3351 return formatAsCommonGigabyte(asBigInteger(numberOfBytes
), pattern
);
3355 * @param numberOfBytes
3356 * The amount of bytes to format.
3358 * The formatting pattern to apply.
3359 * @return The formatted bytes using the default pattern.
3362 public static String
formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes
,
3363 @NonNull final String pattern
) {
3364 return formatAsCommonGigabyte(numberOfBytes
, new DecimalFormat(pattern
));
3368 * @param numberOfBytes
3369 * The amount of bytes to format.
3371 * The formatting pattern to apply.
3373 * The locale to use.
3374 * @return The formatted bytes using the default pattern.
3377 public static String
formatAsCommonGigabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3378 @NonNull final Locale locale
) {
3379 return formatAsCommonGigabyte(numberOfBytes
.longValue(), pattern
, locale
);
3383 * @param numberOfBytes
3384 * The amount of bytes to format.
3386 * The formatting pattern to apply.
3388 * The locale to use.
3389 * @return The formatted bytes using the default pattern.
3392 public static String
formatAsCommonGigabyte(final long numberOfBytes
, @NonNull final String pattern
,
3393 @NonNull final Locale locale
) {
3394 return formatAsCommonGigabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3398 * @param numberOfBytes
3399 * The amount of bytes to format.
3401 * The formatting pattern to apply.
3403 * The locale to use.
3404 * @return The formatted bytes using the default pattern.
3407 public static String
formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3408 @NonNull final Locale locale
) {
3409 return formatAsCommonGigabyte(numberOfBytes
, asFormat(pattern
, locale
));
3413 * @param numberOfBytes
3414 * The amount of bytes to format.
3416 * The formatting pattern to apply.
3417 * @return The formatted bytes using the default pattern.
3420 public static String
formatAsCommonGigabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3421 return formatAsCommonGigabyte(numberOfBytes
.longValue(), format
);
3425 * @param numberOfBytes
3426 * The amount of bytes to format.
3428 * The formatting pattern to apply.
3429 * @return The formatted bytes using the default pattern.
3432 public static String
formatAsCommonGigabyte(final long numberOfBytes
, @NonNull final Format format
) {
3433 return formatAsCommonGigabyte(asBigInteger(numberOfBytes
), format
);
3437 * @param numberOfBytes
3438 * The amount of bytes to format.
3440 * The formatting pattern to apply.
3441 * @return The formatted bytes using the default pattern.
3444 public static String
formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3445 return CommonGigabyte
.valueOf(numberOfBytes
).toString(format
);
3449 * @param numberOfBytes
3450 * The amount of bytes to format.
3451 * @return The formatted bytes using the default pattern.
3454 public static String
formatAsCommonTerabyte(@NonNull final Long numberOfBytes
) {
3455 return formatAsCommonTerabyte(numberOfBytes
.longValue());
3459 * @param numberOfBytes
3460 * The amount of bytes to format.
3461 * @return The formatted bytes using the default pattern.
3464 public static String
formatAsCommonTerabyte(final long numberOfBytes
) {
3465 return formatAsCommonTerabyte(asBigInteger(numberOfBytes
));
3469 * @param numberOfBytes
3470 * The amount of bytes to format.
3471 * @return The formatted bytes using the default pattern.
3474 public static String
formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes
) {
3475 return formatAsCommonTerabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3479 * @param numberOfBytes
3480 * The amount of bytes to format.
3482 * The formatting pattern to apply.
3483 * @return The formatted bytes using the default pattern.
3486 public static String
formatAsCommonTerabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3487 return formatAsCommonTerabyte(numberOfBytes
.longValue(), pattern
);
3491 * @param numberOfBytes
3492 * The amount of bytes to format.
3494 * The formatting pattern to apply.
3495 * @return The formatted bytes using the default pattern.
3498 public static String
formatAsCommonTerabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3499 return formatAsCommonTerabyte(asBigInteger(numberOfBytes
), pattern
);
3503 * @param numberOfBytes
3504 * The amount of bytes to format.
3506 * The formatting pattern to apply.
3507 * @return The formatted bytes using the default pattern.
3510 public static String
formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes
,
3511 @NonNull final String pattern
) {
3512 return formatAsCommonTerabyte(numberOfBytes
, new DecimalFormat(pattern
));
3516 * @param numberOfBytes
3517 * The amount of bytes to format.
3519 * The formatting pattern to apply.
3521 * The locale to use.
3522 * @return The formatted bytes using the default pattern.
3525 public static String
formatAsCommonTerabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3526 @NonNull final Locale locale
) {
3527 return formatAsCommonTerabyte(numberOfBytes
.longValue(), pattern
, locale
);
3531 * @param numberOfBytes
3532 * The amount of bytes to format.
3534 * The formatting pattern to apply.
3536 * The locale to use.
3537 * @return The formatted bytes using the default pattern.
3540 public static String
formatAsCommonTerabyte(final long numberOfBytes
, @NonNull final String pattern
,
3541 @NonNull final Locale locale
) {
3542 return formatAsCommonTerabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3546 * @param numberOfBytes
3547 * The amount of bytes to format.
3549 * The formatting pattern to apply.
3551 * The locale to use.
3552 * @return The formatted bytes using the default pattern.
3555 public static String
formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3556 @NonNull final Locale locale
) {
3557 return formatAsCommonTerabyte(numberOfBytes
, asFormat(pattern
, locale
));
3561 * @param numberOfBytes
3562 * The amount of bytes to format.
3564 * The formatting pattern to apply.
3565 * @return The formatted bytes using the default pattern.
3568 public static String
formatAsCommonTerabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3569 return formatAsCommonTerabyte(numberOfBytes
.longValue(), format
);
3573 * @param numberOfBytes
3574 * The amount of bytes to format.
3576 * The formatting pattern to apply.
3577 * @return The formatted bytes using the default pattern.
3580 public static String
formatAsCommonTerabyte(final long numberOfBytes
, @NonNull final Format format
) {
3581 return formatAsCommonTerabyte(asBigInteger(numberOfBytes
), format
);
3585 * @param numberOfBytes
3586 * The amount of bytes to format.
3588 * The formatting pattern to apply.
3589 * @return The formatted bytes using the default pattern.
3592 public static String
formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3593 return CommonTerabyte
.valueOf(numberOfBytes
).toString(format
);
3597 * @param numberOfBytes
3598 * The amount of bytes to format.
3599 * @return The formatted bytes using the default pattern.
3602 public static String
formatAsCommonPetabyte(@NonNull final Long numberOfBytes
) {
3603 return formatAsCommonPetabyte(numberOfBytes
.longValue());
3607 * @param numberOfBytes
3608 * The amount of bytes to format.
3609 * @return The formatted bytes using the default pattern.
3612 public static String
formatAsCommonPetabyte(final long numberOfBytes
) {
3613 return formatAsCommonPetabyte(asBigInteger(numberOfBytes
));
3617 * @param numberOfBytes
3618 * The amount of bytes to format.
3619 * @return The formatted bytes using the default pattern.
3622 public static String
formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes
) {
3623 return formatAsCommonPetabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3627 * @param numberOfBytes
3628 * The amount of bytes to format.
3630 * The formatting pattern to apply.
3631 * @return The formatted bytes using the default pattern.
3634 public static String
formatAsCommonPetabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3635 return formatAsCommonPetabyte(numberOfBytes
.longValue(), pattern
);
3639 * @param numberOfBytes
3640 * The amount of bytes to format.
3642 * The formatting pattern to apply.
3643 * @return The formatted bytes using the default pattern.
3646 public static String
formatAsCommonPetabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3647 return formatAsCommonPetabyte(asBigInteger(numberOfBytes
), pattern
);
3651 * @param numberOfBytes
3652 * The amount of bytes to format.
3654 * The formatting pattern to apply.
3655 * @return The formatted bytes using the default pattern.
3658 public static String
formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes
,
3659 @NonNull final String pattern
) {
3660 return formatAsCommonPetabyte(numberOfBytes
, new DecimalFormat(pattern
));
3664 * @param numberOfBytes
3665 * The amount of bytes to format.
3667 * The formatting pattern to apply.
3669 * The locale to use.
3670 * @return The formatted bytes using the default pattern.
3673 public static String
formatAsCommonPetabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3674 @NonNull final Locale locale
) {
3675 return formatAsCommonPetabyte(numberOfBytes
.longValue(), pattern
, locale
);
3679 * @param numberOfBytes
3680 * The amount of bytes to format.
3682 * The formatting pattern to apply.
3684 * The locale to use.
3685 * @return The formatted bytes using the default pattern.
3688 public static String
formatAsCommonPetabyte(final long numberOfBytes
, @NonNull final String pattern
,
3689 @NonNull final Locale locale
) {
3690 return formatAsCommonPetabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3694 * @param numberOfBytes
3695 * The amount of bytes to format.
3697 * The formatting pattern to apply.
3699 * The locale to use.
3700 * @return The formatted bytes using the default pattern.
3703 public static String
formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3704 @NonNull final Locale locale
) {
3705 return formatAsCommonPetabyte(numberOfBytes
, asFormat(pattern
, locale
));
3709 * @param numberOfBytes
3710 * The amount of bytes to format.
3712 * The formatting pattern to apply.
3713 * @return The formatted bytes using the default pattern.
3716 public static String
formatAsCommonPetabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3717 return formatAsCommonPetabyte(numberOfBytes
.longValue(), format
);
3721 * @param numberOfBytes
3722 * The amount of bytes to format.
3724 * The formatting pattern to apply.
3725 * @return The formatted bytes using the default pattern.
3728 public static String
formatAsCommonPetabyte(final long numberOfBytes
, @NonNull final Format format
) {
3729 return formatAsCommonPetabyte(asBigInteger(numberOfBytes
), format
);
3733 * @param numberOfBytes
3734 * The amount of bytes to format.
3736 * The formatting pattern to apply.
3737 * @return The formatted bytes using the default pattern.
3740 public static String
formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3741 return CommonPetabyte
.valueOf(numberOfBytes
).toString(format
);
3745 * @param numberOfBytes
3746 * The amount of bytes to format.
3747 * @return The formatted bytes using the default pattern.
3750 public static String
formatAsCommonExabyte(@NonNull final Long numberOfBytes
) {
3751 return formatAsCommonExabyte(numberOfBytes
.longValue());
3755 * @param numberOfBytes
3756 * The amount of bytes to format.
3757 * @return The formatted bytes using the default pattern.
3760 public static String
formatAsCommonExabyte(final long numberOfBytes
) {
3761 return formatAsCommonExabyte(asBigInteger(numberOfBytes
));
3765 * @param numberOfBytes
3766 * The amount of bytes to format.
3767 * @return The formatted bytes using the default pattern.
3770 public static String
formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes
) {
3771 return formatAsCommonExabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3775 * @param numberOfBytes
3776 * The amount of bytes to format.
3778 * The formatting pattern to apply.
3779 * @return The formatted bytes using the default pattern.
3782 public static String
formatAsCommonExabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3783 return formatAsCommonExabyte(numberOfBytes
.longValue(), pattern
);
3787 * @param numberOfBytes
3788 * The amount of bytes to format.
3790 * The formatting pattern to apply.
3791 * @return The formatted bytes using the default pattern.
3794 public static String
formatAsCommonExabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3795 return formatAsCommonExabyte(asBigInteger(numberOfBytes
), pattern
);
3799 * @param numberOfBytes
3800 * The amount of bytes to format.
3802 * The formatting pattern to apply.
3803 * @return The formatted bytes using the default pattern.
3806 public static String
formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
3807 return formatAsCommonExabyte(numberOfBytes
, new DecimalFormat(pattern
));
3811 * @param numberOfBytes
3812 * The amount of bytes to format.
3814 * The formatting pattern to apply.
3816 * The locale to use.
3817 * @return The formatted bytes using the default pattern.
3820 public static String
formatAsCommonExabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3821 @NonNull final Locale locale
) {
3822 return formatAsCommonExabyte(numberOfBytes
.longValue(), pattern
, locale
);
3826 * @param numberOfBytes
3827 * The amount of bytes to format.
3829 * The formatting pattern to apply.
3831 * The locale to use.
3832 * @return The formatted bytes using the default pattern.
3835 public static String
formatAsCommonExabyte(final long numberOfBytes
, @NonNull final String pattern
,
3836 @NonNull final Locale locale
) {
3837 return formatAsCommonExabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3841 * @param numberOfBytes
3842 * The amount of bytes to format.
3844 * The formatting pattern to apply.
3846 * The locale to use.
3847 * @return The formatted bytes using the default pattern.
3850 public static String
formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3851 @NonNull final Locale locale
) {
3852 return formatAsCommonExabyte(numberOfBytes
, asFormat(pattern
, locale
));
3856 * @param numberOfBytes
3857 * The amount of bytes to format.
3859 * The formatting pattern to apply.
3860 * @return The formatted bytes using the default pattern.
3863 public static String
formatAsCommonExabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3864 return formatAsCommonExabyte(numberOfBytes
.longValue(), format
);
3868 * @param numberOfBytes
3869 * The amount of bytes to format.
3871 * The formatting pattern to apply.
3872 * @return The formatted bytes using the default pattern.
3875 public static String
formatAsCommonExabyte(final long numberOfBytes
, @NonNull final Format format
) {
3876 return formatAsCommonExabyte(asBigInteger(numberOfBytes
), format
);
3880 * @param numberOfBytes
3881 * The amount of bytes to format.
3883 * The formatting pattern to apply.
3884 * @return The formatted bytes using the default pattern.
3887 public static String
formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3888 return CommonExabyte
.valueOf(numberOfBytes
).toString(format
);
3892 * @param numberOfBytes
3893 * The amount of bytes to format.
3894 * @return The formatted bytes using the default pattern.
3897 public static String
formatAsCommonZettabyte(@NonNull final Long numberOfBytes
) {
3898 return formatAsCommonZettabyte(numberOfBytes
.longValue());
3902 * @param numberOfBytes
3903 * The amount of bytes to format.
3904 * @return The formatted bytes using the default pattern.
3907 public static String
formatAsCommonZettabyte(final long numberOfBytes
) {
3908 return formatAsCommonZettabyte(asBigInteger(numberOfBytes
));
3912 * @param numberOfBytes
3913 * The amount of bytes to format.
3914 * @return The formatted bytes using the default pattern.
3917 public static String
formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes
) {
3918 return formatAsCommonZettabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3922 * @param numberOfBytes
3923 * The amount of bytes to format.
3925 * The formatting pattern to apply.
3926 * @return The formatted bytes using the default pattern.
3929 public static String
formatAsCommonZettabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3930 return formatAsCommonZettabyte(numberOfBytes
.longValue(), pattern
);
3934 * @param numberOfBytes
3935 * The amount of bytes to format.
3937 * The formatting pattern to apply.
3938 * @return The formatted bytes using the default pattern.
3941 public static String
formatAsCommonZettabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3942 return formatAsCommonZettabyte(asBigInteger(numberOfBytes
), pattern
);
3946 * @param numberOfBytes
3947 * The amount of bytes to format.
3949 * The formatting pattern to apply.
3950 * @return The formatted bytes using the default pattern.
3953 public static String
formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes
,
3954 @NonNull final String pattern
) {
3955 return formatAsCommonZettabyte(numberOfBytes
, new DecimalFormat(pattern
));
3959 * @param numberOfBytes
3960 * The amount of bytes to format.
3962 * The formatting pattern to apply.
3964 * The locale to use.
3965 * @return The formatted bytes using the default pattern.
3968 public static String
formatAsCommonZettabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3969 @NonNull final Locale locale
) {
3970 return formatAsCommonZettabyte(numberOfBytes
.longValue(), pattern
, locale
);
3974 * @param numberOfBytes
3975 * The amount of bytes to format.
3977 * The formatting pattern to apply.
3979 * The locale to use.
3980 * @return The formatted bytes using the default pattern.
3983 public static String
formatAsCommonZettabyte(final long numberOfBytes
, @NonNull final String pattern
,
3984 @NonNull final Locale locale
) {
3985 return formatAsCommonZettabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3989 * @param numberOfBytes
3990 * The amount of bytes to format.
3992 * The formatting pattern to apply.
3994 * The locale to use.
3995 * @return The formatted bytes using the default pattern.
3998 public static String
formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3999 @NonNull final Locale locale
) {
4000 return formatAsCommonZettabyte(numberOfBytes
, asFormat(pattern
, locale
));
4004 * @param numberOfBytes
4005 * The amount of bytes to format.
4007 * The formatting pattern to apply.
4008 * @return The formatted bytes using the default pattern.
4011 public static String
formatAsCommonZettabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
4012 return formatAsCommonZettabyte(numberOfBytes
.longValue(), format
);
4016 * @param numberOfBytes
4017 * The amount of bytes to format.
4019 * The formatting pattern to apply.
4020 * @return The formatted bytes using the default pattern.
4023 public static String
formatAsCommonZettabyte(final long numberOfBytes
, @NonNull final Format format
) {
4024 return formatAsCommonZettabyte(asBigInteger(numberOfBytes
), format
);
4028 * @param numberOfBytes
4029 * The amount of bytes to format.
4031 * The formatting pattern to apply.
4032 * @return The formatted bytes using the default pattern.
4035 public static String
formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes
,
4036 @NonNull final Format format
) {
4037 return CommonZettabyte
.valueOf(numberOfBytes
).toString(format
);
4041 * @param numberOfBytes
4042 * The amount of bytes to format.
4043 * @return The formatted bytes using the default pattern.
4046 public static String
formatAsCommonYottabyte(@NonNull final Long numberOfBytes
) {
4047 return formatAsCommonYottabyte(numberOfBytes
.longValue());
4051 * @param numberOfBytes
4052 * The amount of bytes to format.
4053 * @return The formatted bytes using the default pattern.
4056 public static String
formatAsCommonYottabyte(final long numberOfBytes
) {
4057 return formatAsCommonYottabyte(asBigInteger(numberOfBytes
));
4061 * @param numberOfBytes
4062 * The amount of bytes to format.
4063 * @return The formatted bytes using the default pattern.
4066 public static String
formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes
) {
4067 return formatAsCommonYottabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
4071 * @param numberOfBytes
4072 * The amount of bytes to format.
4074 * The formatting pattern to apply.
4075 * @return The formatted bytes using the default pattern.
4078 public static String
formatAsCommonYottabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
4079 return formatAsCommonYottabyte(numberOfBytes
.longValue(), pattern
);
4083 * @param numberOfBytes
4084 * The amount of bytes to format.
4086 * The formatting pattern to apply.
4087 * @return The formatted bytes using the default pattern.
4090 public static String
formatAsCommonYottabyte(final long numberOfBytes
, @NonNull final String pattern
) {
4091 return formatAsCommonYottabyte(asBigInteger(numberOfBytes
), pattern
);
4095 * @param numberOfBytes
4096 * The amount of bytes to format.
4098 * The formatting pattern to apply.
4100 * The locale to use.
4101 * @return The formatted bytes using the default pattern.
4104 public static String
formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
4105 @NonNull final Locale locale
) {
4106 return formatAsCommonYottabyte(numberOfBytes
, asFormat(pattern
, locale
));
4110 * @param numberOfBytes
4111 * The amount of bytes to format.
4113 * The formatting pattern to apply.
4115 * The locale to use.
4116 * @return The formatted bytes using the default pattern.
4119 public static String
formatAsCommonYottabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
4120 @NonNull final Locale locale
) {
4121 return formatAsCommonYottabyte(numberOfBytes
.longValue(), pattern
, locale
);
4125 * @param numberOfBytes
4126 * The amount of bytes to format.
4128 * The formatting pattern to apply.
4130 * The locale to use.
4131 * @return The formatted bytes using the default pattern.
4134 public static String
formatAsCommonYottabyte(final long numberOfBytes
, @NonNull final String pattern
,
4135 @NonNull final Locale locale
) {
4136 return formatAsCommonYottabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
4140 * @param numberOfBytes
4141 * The amount of bytes to format.
4143 * The formatting pattern to apply.
4144 * @return The formatted bytes using the default pattern.
4147 public static String
formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes
,
4148 @NonNull final String pattern
) {
4149 return formatAsCommonYottabyte(numberOfBytes
, new DecimalFormat(pattern
));
4153 * @param numberOfBytes
4154 * The amount of bytes to format.
4156 * The formatting pattern to apply.
4157 * @return The formatted bytes using the default pattern.
4160 public static String
formatAsCommonYottabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
4161 return formatAsCommonYottabyte(numberOfBytes
.longValue(), format
);
4165 * @param numberOfBytes
4166 * The amount of bytes to format.
4168 * The formatting pattern to apply.
4169 * @return The formatted bytes using the default pattern.
4172 public static String
formatAsCommonYottabyte(final long numberOfBytes
, @NonNull final Format format
) {
4173 return formatAsCommonYottabyte(asBigInteger(numberOfBytes
), format
);
4177 * @param numberOfBytes
4178 * The amount of bytes to format.
4180 * The formatting pattern to apply.
4181 * @return The formatted bytes using the default pattern.
4184 public static String
formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes
,
4185 @NonNull final Format format
) {
4186 return CommonYottabyte
.valueOf(numberOfBytes
).toString(format
);
4190 * @param numberOfBytes
4191 * The amount of bytes to create.
4192 * @return A new unit representing the given amount of bytes.
4195 public static Byte
bytes(@NonNull final Long numberOfBytes
) {
4196 return bytes(numberOfBytes
.longValue());
4200 * @param numberOfBytes
4201 * The amount of bytes to create.
4202 * @return A new unit representing the given amount of bytes.
4205 public static Byte
bytes(final long numberOfBytes
) {
4206 return bytes(asBigInteger(numberOfBytes
));
4210 * @param numberOfBytes
4211 * The amount of bytes to create.
4212 * @return A new unit representing the given amount of bytes.
4215 public static Byte
bytes(@NonNull final BigInteger numberOfBytes
) {
4216 return new Byte(numberOfBytes
);
4220 * @param numberOfKibibytes
4221 * The amount of kibibytes to create.
4222 * @return A new unit representing the given amount of kibibytes.
4225 public static Kibibyte
kibibyte(@NonNull final Long numberOfKibibytes
) {
4226 return kibibyte(numberOfKibibytes
.longValue());
4230 * @param numberOfKibibytes
4231 * The amount of kibibytes to create.
4232 * @return A new unit representing the given amount of kibibytes.
4235 public static Kibibyte
kibibyte(final long numberOfKibibytes
) {
4236 return kibibyte(asBigInteger(numberOfKibibytes
));
4240 * @param numberOfKibibytes
4241 * The amount of kibibytes to create.
4242 * @return A new unit representing the given amount of kibibytes.
4245 public static Kibibyte
kibibyte(@NonNull final BigInteger numberOfKibibytes
) {
4246 return new Kibibyte(multiplyNullsafe(BYTES_IN_A_KIBIBYTE
, numberOfKibibytes
));
4250 * @param numberOfMebibytes
4251 * The amount of mebibytes to create.
4252 * @return A new unit representing the given amount of mebibytes.
4255 public static Mebibyte
mebibyte(@NonNull final Long numberOfMebibytes
) {
4256 return mebibyte(numberOfMebibytes
.longValue());
4260 * @param numberOfMebibytes
4261 * The amount of mebibytes to create.
4262 * @return A new unit representing the given amount of mebibytes.
4265 public static Mebibyte
mebibyte(final long numberOfMebibytes
) {
4266 return mebibyte(asBigInteger(numberOfMebibytes
));
4270 * @param numberOfMebibytes
4271 * The amount of mebibytes to create.
4272 * @return A new unit representing the given amount of mebibytes.
4275 public static Mebibyte
mebibyte(@NonNull final BigInteger numberOfMebibytes
) {
4276 return new Mebibyte(multiplyNullsafe(BYTES_IN_A_MEBIBYTE
, numberOfMebibytes
));
4280 * @param numberOfGibibytes
4281 * The amount of gibibytes to create.
4282 * @return A new unit representing the given amount of gibibytes.
4285 public static Gibibyte
gibibyte(@NonNull final Long numberOfGibibytes
) {
4286 return gibibyte(numberOfGibibytes
.longValue());
4290 * @param numberOfGibibytes
4291 * The amount of gibibytes to create.
4292 * @return A new unit representing the given amount of gibibytes.
4295 public static Gibibyte
gibibyte(final long numberOfGibibytes
) {
4296 return gibibyte(asBigInteger(numberOfGibibytes
));
4300 * @param numberOfGibibytes
4301 * The amount of gibibytes to create.
4302 * @return A new unit representing the given amount of gibibytes.
4305 public static Gibibyte
gibibyte(@NonNull final BigInteger numberOfGibibytes
) {
4306 return new Gibibyte(multiplyNullsafe(BYTES_IN_A_GIBIBYTE
, numberOfGibibytes
));
4310 * @param numberOfTebibytes
4311 * The amount of tebibytes to create.
4312 * @return A new unit representing the given amount of tebibytes.
4315 public static Tebibyte
tebibyte(@NonNull final Long numberOfTebibytes
) {
4316 return tebibyte(numberOfTebibytes
.longValue());
4320 * @param numberOfTebibytes
4321 * The amount of tebibytes to create.
4322 * @return A new unit representing the given amount of tebibytes.
4325 public static Tebibyte
tebibyte(final long numberOfTebibytes
) {
4326 return tebibyte(asBigInteger(numberOfTebibytes
));
4330 * @param numberOfTebibytes
4331 * The amount of tebibytes to create.
4332 * @return A new unit representing the given amount of tebibytes.
4335 public static Tebibyte
tebibyte(@NonNull final BigInteger numberOfTebibytes
) {
4336 return new Tebibyte(multiplyNullsafe(BYTES_IN_A_TEBIBYTE
, numberOfTebibytes
));
4340 * @param numberOfPebibytes
4341 * The amount of pebibytes to create.
4342 * @return A new unit representing the given amount of pebibytes.
4345 public static Pebibyte
pebibyte(@NonNull final Long numberOfPebibytes
) {
4346 return pebibyte(numberOfPebibytes
.longValue());
4350 * @param numberOfPebibytes
4351 * The amount of pebibytes to create.
4352 * @return A new unit representing the given amount of pebibytes.
4355 public static Pebibyte
pebibyte(final long numberOfPebibytes
) {
4356 return pebibyte(asBigInteger(numberOfPebibytes
));
4360 * @param numberOfPebibytes
4361 * The amount of pebibytes to create.
4362 * @return A new unit representing the given amount of pebibytes.
4365 public static Pebibyte
pebibyte(@NonNull final BigInteger numberOfPebibytes
) {
4366 return new Pebibyte(multiplyNullsafe(BYTES_IN_A_PEBIBYTE
, numberOfPebibytes
));
4370 * @param numberOfExbibytes
4371 * The amount of exbibytes to create.
4372 * @return A new unit representing the given amount of exbibytes.
4375 public static Exbibyte
exbibyte(@NonNull final Long numberOfExbibytes
) {
4376 return exbibyte(numberOfExbibytes
.longValue());
4380 * @param numberOfExbibytes
4381 * The amount of exbibytes to create.
4382 * @return A new unit representing the given amount of exbibytes.
4385 public static Exbibyte
exbibyte(final long numberOfExbibytes
) {
4386 return exbibyte(asBigInteger(numberOfExbibytes
));
4390 * @param numberOfExbibytes
4391 * The amount of exbibytes to create.
4392 * @return A new unit representing the given amount of exbibytes.
4395 public static Exbibyte
exbibyte(@NonNull final BigInteger numberOfExbibytes
) {
4396 return new Exbibyte(multiplyNullsafe(BYTES_IN_A_EXBIBYTE
, numberOfExbibytes
));
4400 * @param numberOfZebibytes
4401 * The amount of zebibytes to create.
4402 * @return A new unit representing the given amount of zebibytes.
4405 public static Zebibyte
zebibyte(@NonNull final Long numberOfZebibytes
) {
4406 return zebibyte(numberOfZebibytes
.longValue());
4410 * @param numberOfZebibytes
4411 * The amount of zebibytes to create.
4412 * @return A new unit representing the given amount of zebibytes.
4415 public static Zebibyte
zebibyte(final long numberOfZebibytes
) {
4416 return zebibyte(asBigInteger(numberOfZebibytes
));
4420 * @param numberOfZebibytes
4421 * The amount of zebibytes to create.
4422 * @return A new unit representing the given amount of zebibytes.
4425 public static Zebibyte
zebibyte(@NonNull final BigInteger numberOfZebibytes
) {
4426 return new Zebibyte(multiplyNullsafe(BYTES_IN_A_ZEBIBYTE
, numberOfZebibytes
));
4430 * @param numberOfYobibytes
4431 * The amount of yobibytes to create.
4432 * @return A new unit representing the given amount of yobibytes.
4435 public static Yobibyte
yobibyte(@NonNull final Long numberOfYobibytes
) {
4436 return yobibyte(numberOfYobibytes
.longValue());
4440 * @param numberOfYobibytes
4441 * The amount of yobibytes to create.
4442 * @return A new unit representing the given amount of yobibytes.
4445 public static Yobibyte
yobibyte(final long numberOfYobibytes
) {
4446 return yobibyte(asBigInteger(numberOfYobibytes
));
4450 * @param numberOfYobibytes
4451 * The amount of yobibytes to create.
4452 * @return A new unit representing the given amount of yobibytes.
4455 public static Yobibyte
yobibyte(@NonNull final BigInteger numberOfYobibytes
) {
4456 return new Yobibyte(multiplyNullsafe(BYTES_IN_A_YOBIBYTE
, numberOfYobibytes
));
4460 * @param numberOfKilobytes
4461 * The number of kilobytes to create.
4462 * @return A new unit representing the given amount of kilobytes.
4465 public static Kilobyte
kilobyte(@NonNull final Long numberOfKilobytes
) {
4466 return kilobyte(numberOfKilobytes
.longValue());
4470 * @param numberOfKilobytes
4471 * The number of kilobytes to create.
4472 * @return A new unit representing the given amount of kilobytes.
4475 public static Kilobyte
kilobyte(final long numberOfKilobytes
) {
4476 return kilobyte(asBigInteger(numberOfKilobytes
));
4480 * @param numberOfKilobytes
4481 * The number of kilobytes to create.
4482 * @return A new unit representing the given amount of kilobytes.
4485 public static Kilobyte
kilobyte(@NonNull final BigInteger numberOfKilobytes
) {
4486 return new Kilobyte(multiplyNullsafe(BYTES_IN_A_KILOBYTE
, numberOfKilobytes
));
4490 * @param numberOfMegabytes
4491 * The number of megabytes to create.
4492 * @return A new unit representing the given amount of megabytes.
4495 public static Megabyte
megabyte(@NonNull final Long numberOfMegabytes
) {
4496 return megabyte(numberOfMegabytes
.longValue());
4500 * @param numberOfMegabytes
4501 * The number of megabytes to create.
4502 * @return A new unit representing the given amount of megabytes.
4505 public static Megabyte
megabyte(final long numberOfMegabytes
) {
4506 return megabyte(asBigInteger(numberOfMegabytes
));
4510 * @param numberOfMegabytes
4511 * The number of megabytes to create.
4512 * @return A new unit representing the given amount of megabytes.
4515 public static Megabyte
megabyte(@NonNull final BigInteger numberOfMegabytes
) {
4516 return new Megabyte(multiplyNullsafe(BYTES_IN_A_MEGABYTE
, numberOfMegabytes
));
4520 * @param numberOfGigabytes
4521 * The number of gigabytes to create.
4522 * @return A new unit representing the given amount of gigabytes.
4525 public static Gigabyte
gigabyte(@NonNull final Long numberOfGigabytes
) {
4526 return gigabyte(numberOfGigabytes
.longValue());
4530 * @param numberOfGigabytes
4531 * The number of gigabytes to create.
4532 * @return A new unit representing the given amount of gigabytes.
4535 public static Gigabyte
gigabyte(final long numberOfGigabytes
) {
4536 return gigabyte(asBigInteger(numberOfGigabytes
));
4540 * @param numberOfGigabytes
4541 * The number of gigabytes to create.
4542 * @return A new unit representing the given amount of gigabytes.
4545 public static Gigabyte
gigabyte(@NonNull final BigInteger numberOfGigabytes
) {
4546 return new Gigabyte(multiplyNullsafe(BYTES_IN_A_GIGABYTE
, numberOfGigabytes
));
4550 * @param numberOfTerabytes
4551 * The number of terabytes to create.
4552 * @return A new unit representing the given amount of terabytes.
4555 public static Terabyte
terabyte(@NonNull final Long numberOfTerabytes
) {
4556 return terabyte(numberOfTerabytes
.longValue());
4560 * @param numberOfTerabytes
4561 * The number of terabytes to create.
4562 * @return A new unit representing the given amount of terabytes.
4565 public static Terabyte
terabyte(final long numberOfTerabytes
) {
4566 return terabyte(asBigInteger(numberOfTerabytes
));
4570 * @param numberOfTerabytes
4571 * The number of terabytes to create.
4572 * @return A new unit representing the given amount of terabytes.
4575 public static Terabyte
terabyte(@NonNull final BigInteger numberOfTerabytes
) {
4576 return new Terabyte(multiplyNullsafe(BYTES_IN_A_TERABYTE
, numberOfTerabytes
));
4580 * @param numberOfPetabytes
4581 * The number of petabytes to create.
4582 * @return A new unit representing the given amount of petabytes.
4585 public static Petabyte
petabyte(@NonNull final Long numberOfPetabytes
) {
4586 return petabyte(numberOfPetabytes
.longValue());
4590 * @param numberOfPetabytes
4591 * The number of petabytes to create.
4592 * @return A new unit representing the given amount of petabytes.
4595 public static Petabyte
petabyte(final long numberOfPetabytes
) {
4596 return petabyte(asBigInteger(numberOfPetabytes
));
4600 * @param numberOfPetabytes
4601 * The number of petabytes to create.
4602 * @return A new unit representing the given amount of petabytes.
4605 public static Petabyte
petabyte(@NonNull final BigInteger numberOfPetabytes
) {
4606 return new Petabyte(multiplyNullsafe(BYTES_IN_A_PETABYTE
, numberOfPetabytes
));
4610 * @param numberOfExabytes
4611 * The number of exabytes to create.
4612 * @return A new unit representing the given amount of exabytes.
4615 public static Exabyte
exabyte(@NonNull final Long numberOfExabytes
) {
4616 return exabyte(numberOfExabytes
.longValue());
4620 * @param numberOfExabytes
4621 * The number of exabytes to create.
4622 * @return A new unit representing the given amount of exabytes.
4625 public static Exabyte
exabyte(final long numberOfExabytes
) {
4626 return exabyte(asBigInteger(numberOfExabytes
));
4630 * @param numberOfExabytes
4631 * The number of exabytes to create.
4632 * @return A new unit representing the given amount of exabytes.
4635 public static Exabyte
exabyte(@NonNull final BigInteger numberOfExabytes
) {
4636 return new Exabyte(multiplyNullsafe(BYTES_IN_A_EXABYTE
, numberOfExabytes
));
4640 * @param numberOfZettabytes
4641 * The number of zettabytes to create.
4642 * @return A new unit representing the given amount of zettabytes.
4645 public static Zettabyte
zettabyte(@NonNull final Long numberOfZettabytes
) {
4646 return zettabyte(numberOfZettabytes
.longValue());
4650 * @param numberOfZettabytes
4651 * The number of zettabytes to create.
4652 * @return A new unit representing the given amount of zettabytes.
4655 public static Zettabyte
zettabyte(final long numberOfZettabytes
) {
4656 return zettabyte(asBigInteger(numberOfZettabytes
));
4660 * @param numberOfZettabytes
4661 * The number of zettabytes to create.
4662 * @return A new unit representing the given amount of zettabytes.
4665 public static Zettabyte
zettabyte(@NonNull final BigInteger numberOfZettabytes
) {
4666 return new Zettabyte(multiplyNullsafe(BYTES_IN_A_ZETTABYTE
, numberOfZettabytes
));
4670 * @param numberOfYottabytes
4671 * The number of yottabytes to create.
4672 * @return A new unit representing the given amount of yottabytes.
4675 public static Yottabyte
yottabyte(@NonNull final Long numberOfYottabytes
) {
4676 return yottabyte(numberOfYottabytes
.longValue());
4680 * @param numberOfYottabytes
4681 * The number of yottabytes to create.
4682 * @return A new unit representing the given amount of yottabytes.
4685 public static Yottabyte
yottabyte(final long numberOfYottabytes
) {
4686 return yottabyte(asBigInteger(numberOfYottabytes
));
4690 * @param numberOfYottabytes
4691 * The number of yottabytes to create.
4692 * @return A new unit representing the given amount of yottabytes.
4695 public static Yottabyte
yottabyte(@NonNull final BigInteger numberOfYottabytes
) {
4696 return new Yottabyte(multiplyNullsafe(BYTES_IN_A_YOTTABYTE
, numberOfYottabytes
));
4700 * @param numberOfKilobytes
4701 * The number of kilobytes to create.
4702 * @return A new unit representing the given amount of kilobytes.
4705 public static CommonKilobyte
commonKilobyte(@NonNull final Long numberOfKilobytes
) {
4706 return commonKilobyte(numberOfKilobytes
.longValue());
4710 * @param numberOfKilobytes
4711 * The number of kilobytes to create.
4712 * @return A new unit representing the given amount of kilobytes.
4715 public static CommonKilobyte
commonKilobyte(final long numberOfKilobytes
) {
4716 return commonKilobyte(asBigInteger(numberOfKilobytes
));
4720 * @param numberOfKilobytes
4721 * The number of kilobytes to create.
4722 * @return A new unit representing the given amount of kilobytes.
4725 public static CommonKilobyte
commonKilobyte(@NonNull final BigInteger numberOfKilobytes
) {
4726 return new CommonKilobyte(multiplyNullsafe(BYTES_IN_A_KIBIBYTE
, numberOfKilobytes
));
4730 * @param numberOfMegabytes
4731 * The number of megabytes to create.
4732 * @return A new unit representing the given amount of megabytes.
4735 public static CommonMegabyte
commonMegabyte(@NonNull final Long numberOfMegabytes
) {
4736 return commonMegabyte(numberOfMegabytes
.longValue());
4740 * @param numberOfMegabytes
4741 * The number of megabytes to create.
4742 * @return A new unit representing the given amount of megabytes.
4745 public static CommonMegabyte
commonMegabyte(final long numberOfMegabytes
) {
4746 return commonMegabyte(asBigInteger(numberOfMegabytes
));
4750 * @param numberOfMegabytes
4751 * The number of megabytes to create.
4752 * @return A new unit representing the given amount of megabytes.
4755 public static CommonMegabyte
commonMegabyte(@NonNull final BigInteger numberOfMegabytes
) {
4756 return new CommonMegabyte(multiplyNullsafe(BYTES_IN_A_MEBIBYTE
, numberOfMegabytes
));
4760 * @param numberOfGigabytes
4761 * The number of gigabytes to create.
4762 * @return A new unit representing the given amount of gigabytes.
4765 public static CommonGigabyte
commonGigabyte(@NonNull final Long numberOfGigabytes
) {
4766 return commonGigabyte(numberOfGigabytes
.longValue());
4770 * @param numberOfGigabytes
4771 * The number of gigabytes to create.
4772 * @return A new unit representing the given amount of gigabytes.
4775 public static CommonGigabyte
commonGigabyte(final long numberOfGigabytes
) {
4776 return commonGigabyte(asBigInteger(numberOfGigabytes
));
4780 * @param numberOfGigabytes
4781 * The number of gigabytes to create.
4782 * @return A new unit representing the given amount of gigabytes.
4785 public static CommonGigabyte
commonGigabyte(@NonNull final BigInteger numberOfGigabytes
) {
4786 return new CommonGigabyte(multiplyNullsafe(BYTES_IN_A_GIBIBYTE
, numberOfGigabytes
));
4790 * @param numberOfTerabytes
4791 * The number of terabytes to create.
4792 * @return A new unit representing the given amount of terabytes.
4795 public static CommonTerabyte
commonTerabyte(@NonNull final Long numberOfTerabytes
) {
4796 return commonTerabyte(numberOfTerabytes
.longValue());
4800 * @param numberOfTerabytes
4801 * The number of terabytes to create.
4802 * @return A new unit representing the given amount of terabytes.
4805 public static CommonTerabyte
commonTerabyte(final long numberOfTerabytes
) {
4806 return commonTerabyte(asBigInteger(numberOfTerabytes
));
4810 * @param numberOfTerabytes
4811 * The number of terabytes to create.
4812 * @return A new unit representing the given amount of terabytes.
4815 public static CommonTerabyte
commonTerabyte(@NonNull final BigInteger numberOfTerabytes
) {
4816 return new CommonTerabyte(multiplyNullsafe(BYTES_IN_A_TEBIBYTE
, numberOfTerabytes
));
4820 * @param numberOfPetabytes
4821 * The number of petabytes to create.
4822 * @return A new unit representing the given amount of petabytes.
4825 public static CommonPetabyte
commonPetabyte(@NonNull final Long numberOfPetabytes
) {
4826 return commonPetabyte(numberOfPetabytes
.longValue());
4830 * @param numberOfPetabytes
4831 * The number of petabytes to create.
4832 * @return A new unit representing the given amount of petabytes.
4835 public static CommonPetabyte
commonPetabyte(final long numberOfPetabytes
) {
4836 return commonPetabyte(asBigInteger(numberOfPetabytes
));
4840 * @param numberOfPetabytes
4841 * The number of petabytes to create.
4842 * @return A new unit representing the given amount of petabytes.
4845 public static CommonPetabyte
commonPetabyte(@NonNull final BigInteger numberOfPetabytes
) {
4846 return new CommonPetabyte(multiplyNullsafe(BYTES_IN_A_PEBIBYTE
, numberOfPetabytes
));
4850 * @param numberOfExabytes
4851 * The number of exabytes to create.
4852 * @return A new unit representing the given amount of exabytes.
4855 public static CommonExabyte
commonExabyte(@NonNull final Long numberOfExabytes
) {
4856 return commonExabyte(numberOfExabytes
.longValue());
4860 * @param numberOfExabytes
4861 * The number of exabytes to create.
4862 * @return A new unit representing the given amount of exabytes.
4865 public static CommonExabyte
commonExabyte(final long numberOfExabytes
) {
4866 return commonExabyte(asBigInteger(numberOfExabytes
));
4870 * @param numberOfExabytes
4871 * The number of exabytes to create.
4872 * @return A new unit representing the given amount of exabytes.
4875 public static CommonExabyte
commonExabyte(@NonNull final BigInteger numberOfExabytes
) {
4876 return new CommonExabyte(multiplyNullsafe(BYTES_IN_A_EXBIBYTE
, numberOfExabytes
));
4880 * @param numberOfZettabytes
4881 * The number of zettabytes to create.
4882 * @return A new unit representing the given amount of zettabytes.
4885 public static CommonZettabyte
commonZettabyte(@NonNull final Long numberOfZettabytes
) {
4886 return commonZettabyte(numberOfZettabytes
.longValue());
4890 * @param numberOfZettabytes
4891 * The number of zettabytes to create.
4892 * @return A new unit representing the given amount of zettabytes.
4895 public static CommonZettabyte
commonZettabyte(final long numberOfZettabytes
) {
4896 return commonZettabyte(asBigInteger(numberOfZettabytes
));
4900 * @param numberOfZettabytes
4901 * The number of zettabytes to create.
4902 * @return A new unit representing the given amount of zettabytes.
4905 public static CommonZettabyte
commonZettabyte(@NonNull final BigInteger numberOfZettabytes
) {
4906 return new CommonZettabyte(multiplyNullsafe(BYTES_IN_A_ZEBIBYTE
, numberOfZettabytes
));
4910 * @param numberOfYottabytes
4911 * The number of yottabytes to create.
4912 * @return A new unit representing the given amount of yottabytes.
4915 public static CommonYottabyte
commonYottabyte(@NonNull final Long numberOfYottabytes
) {
4916 return commonYottabyte(numberOfYottabytes
.longValue());
4920 * @param numberOfYottabytes
4921 * The number of yottabytes to create.
4922 * @return A new unit representing the given amount of yottabytes.
4925 public static CommonYottabyte
commonYottabyte(final long numberOfYottabytes
) {
4926 return commonYottabyte(asBigInteger(numberOfYottabytes
));
4930 * @param numberOfYottabytes
4931 * The number of yottabytes to create.
4932 * @return A new unit representing the given amount of yottabytes.
4935 public static CommonYottabyte
commonYottabyte(@NonNull final BigInteger numberOfYottabytes
) {
4936 return new CommonYottabyte(multiplyNullsafe(BYTES_IN_A_YOBIBYTE
, numberOfYottabytes
));