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
.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
.storage_unit
.FormatUtils
.asFormat
;
13 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_EXABYTE
;
14 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_EXBIBYTE
;
15 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_GIBIBYTE
;
16 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_GIGABYTE
;
17 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_KIBIBYTE
;
18 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_KILOBYTE
;
19 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_MEBIBYTE
;
20 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_MEGABYTE
;
21 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_PEBIBYTE
;
22 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_PETABYTE
;
23 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_TEBIBYTE
;
24 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_TERABYTE
;
25 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_YOBIBYTE
;
26 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_YOTTABYTE
;
27 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_ZEBIBYTE
;
28 import static de
.xn__ho_hia
.storage_unit
.StorageUnit
.BYTES_IN_A_ZETTABYTE
;
29 import static de
.xn__ho_hia
.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
54 public static StorageUnit
<?
> binaryValueOf(final long bytes
) {
55 return binaryValueOf(asBigInteger(bytes
));
60 * The amount to bytes to represent.
61 * @return The appropriate binary-prefixed unit for the given amount of
65 public static StorageUnit
<?
> binaryValueOf(@NonNull final BigInteger bytes
) {
66 StorageUnit
<?
> unit
= Byte
.valueOf(bytes
);
68 final BigInteger positiveNumberOfBytes
= bytes
.signum() == -1 ?
nonNull(bytes
.negate()) : bytes
;
70 if (inbetween(BYTES_IN_A_KIBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_MEBIBYTE
)) {
71 unit
= unit
.asKibibyte();
72 } else if (inbetween(BYTES_IN_A_MEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_GIBIBYTE
)) {
73 unit
= unit
.asMebibyte();
74 } else if (inbetween(BYTES_IN_A_GIBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_TEBIBYTE
)) {
75 unit
= unit
.asGibibyte();
76 } else if (inbetween(BYTES_IN_A_TEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_PEBIBYTE
)) {
77 unit
= unit
.asTebibyte();
78 } else if (inbetween(BYTES_IN_A_PEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_EXBIBYTE
)) {
79 unit
= unit
.asPebibyte();
80 } else if (inbetween(BYTES_IN_A_EXBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_ZEBIBYTE
)) {
81 unit
= unit
.asExbibyte();
82 } else if (inbetween(BYTES_IN_A_ZEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_YOBIBYTE
)) {
83 unit
= unit
.asZebibyte();
84 } else if (greaterThanEquals(positiveNumberOfBytes
, BYTES_IN_A_YOBIBYTE
)) {
85 unit
= unit
.asYobibyte();
93 * The amount of bytes to represent.
94 * @return The appropriate metric-prefixed unit for the given amount of
98 public static StorageUnit
<?
> metricValueOf(final long bytes
) {
99 return metricValueOf(asBigInteger(bytes
));
104 * The amount of bytes to represent.
105 * @return The appropriate metric-prefixed unit for the given amount of
109 public static StorageUnit
<?
> metricValueOf(@NonNull final BigInteger bytes
) {
110 StorageUnit
<?
> unit
= Byte
.valueOf(bytes
);
112 final BigInteger positiveNumberOfBytes
= bytes
.signum() == -1 ?
nonNull(bytes
.negate()) : bytes
;
114 if (inbetween(BYTES_IN_A_KILOBYTE
, positiveNumberOfBytes
, BYTES_IN_A_MEGABYTE
)) {
115 unit
= unit
.asKilobyte();
116 } else if (inbetween(BYTES_IN_A_MEGABYTE
, positiveNumberOfBytes
, BYTES_IN_A_GIGABYTE
)) {
117 unit
= unit
.asMegabyte();
118 } else if (inbetween(BYTES_IN_A_GIGABYTE
, positiveNumberOfBytes
, BYTES_IN_A_TERABYTE
)) {
119 unit
= unit
.asGigabyte();
120 } else if (inbetween(BYTES_IN_A_TERABYTE
, positiveNumberOfBytes
, BYTES_IN_A_PETABYTE
)) {
121 unit
= unit
.asTerabyte();
122 } else if (inbetween(BYTES_IN_A_PETABYTE
, positiveNumberOfBytes
, BYTES_IN_A_EXABYTE
)) {
123 unit
= unit
.asPetabyte();
124 } else if (inbetween(BYTES_IN_A_EXABYTE
, positiveNumberOfBytes
, BYTES_IN_A_ZETTABYTE
)) {
125 unit
= unit
.asExabyte();
126 } else if (inbetween(BYTES_IN_A_ZETTABYTE
, positiveNumberOfBytes
, BYTES_IN_A_YOTTABYTE
)) {
127 unit
= unit
.asZettabyte();
128 } else if (greaterThanEquals(positiveNumberOfBytes
, BYTES_IN_A_YOTTABYTE
)) {
129 unit
= unit
.asYottabyte();
137 * The amount to bytes to represent.
138 * @return The appropriate common unit for the given amount of bytes.
141 public static StorageUnit
<?
> commonValueOf(final long bytes
) {
142 return commonValueOf(asBigInteger(bytes
));
147 * The amount to bytes to represent.
148 * @return The appropriate common unit for the given amount of bytes.
151 public static StorageUnit
<?
> commonValueOf(@NonNull final BigInteger bytes
) {
152 StorageUnit
<?
> unit
= Byte
.valueOf(bytes
);
154 final BigInteger positiveNumberOfBytes
= bytes
.signum() == -1 ?
nonNull(bytes
.negate()) : bytes
;
156 if (inbetween(BYTES_IN_A_KIBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_MEBIBYTE
)) {
157 unit
= unit
.asCommonKilobyte();
158 } else if (inbetween(BYTES_IN_A_MEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_GIBIBYTE
)) {
159 unit
= unit
.asCommonMegabyte();
160 } else if (inbetween(BYTES_IN_A_GIBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_TEBIBYTE
)) {
161 unit
= unit
.asCommonGigabyte();
162 } else if (inbetween(BYTES_IN_A_TEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_PEBIBYTE
)) {
163 unit
= unit
.asCommonTerabyte();
164 } else if (inbetween(BYTES_IN_A_PEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_EXBIBYTE
)) {
165 unit
= unit
.asCommonPetabyte();
166 } else if (inbetween(BYTES_IN_A_EXBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_ZEBIBYTE
)) {
167 unit
= unit
.asCommonExabyte();
168 } else if (inbetween(BYTES_IN_A_ZEBIBYTE
, positiveNumberOfBytes
, BYTES_IN_A_YOBIBYTE
)) {
169 unit
= unit
.asCommonZettabyte();
170 } else if (greaterThanEquals(positiveNumberOfBytes
, BYTES_IN_A_YOBIBYTE
)) {
171 unit
= unit
.asCommonYottabyte();
177 private static boolean inbetween(final BigInteger start
, final BigInteger value
, final BigInteger endExclusive
) {
178 return greaterThanEquals(value
, start
) && value
.compareTo(endExclusive
) < 0;
181 private static boolean greaterThanEquals(final BigInteger value
, final BigInteger comparison
) {
182 return value
.compareTo(comparison
) >= 0;
186 * @param numberOfBytes
187 * The amount of bytes to format.
188 * @return The formatted bytes using the default pattern.
191 public static String
formatAsByte(@NonNull final Long numberOfBytes
) {
192 return formatAsByte(numberOfBytes
.longValue());
196 * @param numberOfBytes
197 * The amount of bytes to format.
198 * @return The formatted bytes using the default pattern.
201 public static String
formatAsByte(final long numberOfBytes
) {
202 return formatAsByte(asBigInteger(numberOfBytes
));
206 * @param numberOfBytes
207 * The amount of bytes to format.
208 * @return The formatted bytes using the default pattern.
211 public static String
formatAsByte(@NonNull final BigInteger numberOfBytes
) {
212 return numberOfBytes
.toString() + " B"; //$NON-NLS-1$
216 * @param numberOfBytes
217 * The amount of bytes to format.
218 * @return The formatted bytes using the default pattern.
221 public static String
formatAsBinaryUnit(@NonNull final Long numberOfBytes
) {
222 return formatAsBinaryUnit(numberOfBytes
.longValue());
226 * @param numberOfBytes
227 * The amount of bytes to format.
228 * @return The formatted bytes using the default pattern.
231 public static String
formatAsBinaryUnit(final long numberOfBytes
) {
232 return formatAsBinaryUnit(asBigInteger(numberOfBytes
));
236 * @param numberOfBytes
237 * The amount of bytes to format.
238 * @return The formatted bytes using the default pattern.
241 public static String
formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes
) {
242 return formatAsBinaryUnit(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
246 * @param numberOfBytes
247 * The amount of bytes to format.
249 * The formatting pattern to apply.
250 * @return The formatted bytes using the default pattern.
253 public static String
formatAsBinaryUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
254 return formatAsBinaryUnit(numberOfBytes
.longValue(), pattern
);
258 * @param numberOfBytes
259 * The amount of bytes to format.
261 * The formatting pattern to apply.
262 * @return The formatted bytes using the default pattern.
265 public static String
formatAsBinaryUnit(final long numberOfBytes
, @NonNull final String pattern
) {
266 return formatAsBinaryUnit(asBigInteger(numberOfBytes
), pattern
);
270 * @param numberOfBytes
271 * The amount of bytes to format.
273 * The formatting pattern to apply.
274 * @return The formatted bytes using the default pattern.
277 public static String
formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
278 return formatAsBinaryUnit(numberOfBytes
, new DecimalFormat(pattern
));
282 * @param numberOfBytes
283 * The amount of bytes to format.
285 * The formatting pattern to apply.
288 * @return The formatted bytes using the default pattern.
291 public static String
formatAsBinaryUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
292 @NonNull final Locale locale
) {
293 return formatAsBinaryUnit(numberOfBytes
.longValue(), pattern
, locale
);
297 * @param numberOfBytes
298 * The amount of bytes to format.
300 * The formatting pattern to apply.
303 * @return The formatted bytes using the default pattern.
306 public static String
formatAsBinaryUnit(final long numberOfBytes
, @NonNull final String pattern
,
307 @NonNull final Locale locale
) {
308 return formatAsBinaryUnit(asBigInteger(numberOfBytes
), pattern
, locale
);
312 * @param numberOfBytes
313 * The amount of bytes to format.
315 * The formatting pattern to apply.
318 * @return The formatted bytes using the default pattern.
321 public static String
formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
322 @NonNull final Locale locale
) {
323 return formatAsBinaryUnit(numberOfBytes
, asFormat(pattern
, locale
));
327 * @param numberOfBytes
328 * The amount of bytes to format.
330 * The formatting pattern to apply.
331 * @return The formatted bytes using the default pattern.
334 public static String
formatAsBinaryUnit(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
335 return formatAsBinaryUnit(numberOfBytes
.longValue(), format
);
339 * @param numberOfBytes
340 * The amount of bytes to format.
342 * The formatting pattern to apply.
343 * @return The formatted bytes using the default pattern.
346 public static String
formatAsBinaryUnit(final long numberOfBytes
, @NonNull final Format format
) {
347 return formatAsBinaryUnit(asBigInteger(numberOfBytes
), format
);
351 * @param numberOfBytes
352 * The amount of bytes to format.
354 * The formatting pattern to apply.
355 * @return The formatted bytes using the default pattern.
358 public static String
formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
359 return binaryValueOf(numberOfBytes
).toString(format
);
363 * @param numberOfBytes
364 * The amount of bytes to format.
365 * @return The formatted bytes using the default pattern.
368 public static String
formatAsKibibyte(@NonNull final Long numberOfBytes
) {
369 return formatAsKibibyte(numberOfBytes
.longValue());
373 * @param numberOfBytes
374 * The amount of bytes to format.
375 * @return The formatted bytes using the default pattern.
378 public static String
formatAsKibibyte(final long numberOfBytes
) {
379 return formatAsKibibyte(asBigInteger(numberOfBytes
));
383 * @param numberOfBytes
384 * The amount of bytes to format.
385 * @return The formatted bytes using the default pattern.
388 public static String
formatAsKibibyte(@NonNull final BigInteger numberOfBytes
) {
389 return formatAsKibibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
393 * @param numberOfBytes
394 * The amount of bytes to format.
396 * The formatting pattern to apply.
397 * @return The formatted bytes using the default pattern.
400 public static String
formatAsKibibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
401 return formatAsKibibyte(numberOfBytes
.longValue(), pattern
);
405 * @param numberOfBytes
406 * The amount of bytes to format.
408 * The formatting pattern to apply.
409 * @return The formatted bytes using the default pattern.
412 public static String
formatAsKibibyte(final long numberOfBytes
, @NonNull final String pattern
) {
413 return formatAsKibibyte(asBigInteger(numberOfBytes
), pattern
);
417 * @param numberOfBytes
418 * The amount of bytes to format.
420 * The formatting pattern to apply.
421 * @return The formatted bytes using the default pattern.
424 public static String
formatAsKibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
425 return formatAsKibibyte(numberOfBytes
, new DecimalFormat(pattern
));
429 * @param numberOfBytes
430 * The amount of bytes to format.
432 * The formatting pattern to apply.
435 * @return The formatted bytes using the default pattern.
438 public static String
formatAsKibibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
439 @NonNull final Locale locale
) {
440 return formatAsKibibyte(numberOfBytes
.longValue(), pattern
, locale
);
444 * @param numberOfBytes
445 * The amount of bytes to format.
447 * The formatting pattern to apply.
450 * @return The formatted bytes using the default pattern.
453 public static String
formatAsKibibyte(final long numberOfBytes
, @NonNull final String pattern
,
454 @NonNull final Locale locale
) {
455 return formatAsKibibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
459 * @param numberOfBytes
460 * The amount of bytes to format.
462 * The formatting pattern to apply.
465 * @return The formatted bytes using the default pattern.
468 public static String
formatAsKibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
469 @NonNull final Locale locale
) {
470 return formatAsKibibyte(numberOfBytes
, asFormat(pattern
, locale
));
474 * @param numberOfBytes
475 * The amount of bytes to format.
477 * The formatting pattern to apply.
478 * @return The formatted bytes using the default pattern.
481 public static String
formatAsKibibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
482 return formatAsKibibyte(numberOfBytes
.longValue(), format
);
486 * @param numberOfBytes
487 * The amount of bytes to format.
489 * The formatting pattern to apply.
490 * @return The formatted bytes using the default pattern.
493 public static String
formatAsKibibyte(final long numberOfBytes
, @NonNull final Format format
) {
494 return formatAsKibibyte(asBigInteger(numberOfBytes
), format
);
498 * @param numberOfBytes
499 * The amount of bytes to format.
501 * The formatting pattern to apply.
502 * @return The formatted bytes using the default pattern.
505 public static String
formatAsKibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
506 return Kibibyte
.valueOf(numberOfBytes
).toString(format
);
510 * @param numberOfBytes
511 * The amount of bytes to format.
512 * @return The formatted bytes using the default pattern.
515 public static String
formatAsMebibyte(@NonNull final Long numberOfBytes
) {
516 return formatAsMebibyte(numberOfBytes
.longValue());
520 * @param numberOfBytes
521 * The amount of bytes to format.
522 * @return The formatted bytes using the default pattern.
525 public static String
formatAsMebibyte(final long numberOfBytes
) {
526 return formatAsMebibyte(asBigInteger(numberOfBytes
));
530 * @param numberOfBytes
531 * The amount of bytes to format.
532 * @return The formatted bytes using the default pattern.
535 public static String
formatAsMebibyte(@NonNull final BigInteger numberOfBytes
) {
536 return formatAsMebibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
540 * @param numberOfBytes
541 * The amount of bytes to format.
543 * The formatting pattern to apply.
544 * @return The formatted bytes using the default pattern.
547 public static String
formatAsMebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
548 return formatAsMebibyte(numberOfBytes
.longValue(), pattern
);
552 * @param numberOfBytes
553 * The amount of bytes to format.
555 * The formatting pattern to apply.
556 * @return The formatted bytes using the default pattern.
559 public static String
formatAsMebibyte(final long numberOfBytes
, @NonNull final String pattern
) {
560 return formatAsMebibyte(asBigInteger(numberOfBytes
), pattern
);
564 * @param numberOfBytes
565 * The amount of bytes to format.
567 * The formatting pattern to apply.
568 * @return The formatted bytes using the default pattern.
571 public static String
formatAsMebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
572 return formatAsMebibyte(numberOfBytes
, new DecimalFormat(pattern
));
576 * @param numberOfBytes
577 * The amount of bytes to format.
579 * The formatting pattern to apply.
582 * @return The formatted bytes using the default pattern.
585 public static String
formatAsMebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
586 @NonNull final Locale locale
) {
587 return formatAsMebibyte(numberOfBytes
.longValue(), pattern
, locale
);
591 * @param numberOfBytes
592 * The amount of bytes to format.
594 * The formatting pattern to apply.
597 * @return The formatted bytes using the default pattern.
600 public static String
formatAsMebibyte(final long numberOfBytes
, @NonNull final String pattern
,
601 @NonNull final Locale locale
) {
602 return formatAsMebibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
606 * @param numberOfBytes
607 * The amount of bytes to format.
609 * The formatting pattern to apply.
612 * @return The formatted bytes using the default pattern.
615 public static String
formatAsMebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
616 @NonNull final Locale locale
) {
617 return formatAsMebibyte(numberOfBytes
, asFormat(pattern
, locale
));
621 * @param numberOfBytes
622 * The amount of bytes to format.
624 * The formatting pattern to apply.
625 * @return The formatted bytes using the default pattern.
628 public static String
formatAsMebibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
629 return formatAsMebibyte(numberOfBytes
.longValue(), format
);
633 * @param numberOfBytes
634 * The amount of bytes to format.
636 * The formatting pattern to apply.
637 * @return The formatted bytes using the default pattern.
640 public static String
formatAsMebibyte(final long numberOfBytes
, @NonNull final Format format
) {
641 return formatAsMebibyte(asBigInteger(numberOfBytes
), format
);
645 * @param numberOfBytes
646 * The amount of bytes to format.
648 * The formatting pattern to apply.
649 * @return The formatted bytes using the default pattern.
652 public static String
formatAsMebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
653 return Mebibyte
.valueOf(numberOfBytes
).toString(format
);
657 * @param numberOfBytes
658 * The amount of bytes to format.
659 * @return The formatted bytes using the default pattern.
662 public static String
formatAsGibibyte(@NonNull final Long numberOfBytes
) {
663 return formatAsGibibyte(numberOfBytes
.longValue());
667 * @param numberOfBytes
668 * The amount of bytes to format.
669 * @return The formatted bytes using the default pattern.
672 public static String
formatAsGibibyte(final long numberOfBytes
) {
673 return formatAsGibibyte(asBigInteger(numberOfBytes
));
677 * @param numberOfBytes
678 * The amount of bytes to format.
679 * @return The formatted bytes using the default pattern.
682 public static String
formatAsGibibyte(@NonNull final BigInteger numberOfBytes
) {
683 return formatAsGibibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
687 * @param numberOfBytes
688 * The amount of bytes to format.
690 * The formatting pattern to apply.
691 * @return The formatted bytes using the default pattern.
694 public static String
formatAsGibibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
695 return formatAsGibibyte(numberOfBytes
.longValue(), pattern
);
699 * @param numberOfBytes
700 * The amount of bytes to format.
702 * The formatting pattern to apply.
703 * @return The formatted bytes using the default pattern.
706 public static String
formatAsGibibyte(final long numberOfBytes
, @NonNull final String pattern
) {
707 return formatAsGibibyte(asBigInteger(numberOfBytes
), pattern
);
711 * @param numberOfBytes
712 * The amount of bytes to format.
714 * The formatting pattern to apply.
715 * @return The formatted bytes using the default pattern.
718 public static String
formatAsGibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
719 return formatAsGibibyte(numberOfBytes
, new DecimalFormat(pattern
));
723 * @param numberOfBytes
724 * The amount of bytes to format.
726 * The formatting pattern to apply.
729 * @return The formatted bytes using the default pattern.
732 public static String
formatAsGibibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
733 @NonNull final Locale locale
) {
734 return formatAsGibibyte(numberOfBytes
.longValue(), pattern
, locale
);
738 * @param numberOfBytes
739 * The amount of bytes to format.
741 * The formatting pattern to apply.
744 * @return The formatted bytes using the default pattern.
747 public static String
formatAsGibibyte(final long numberOfBytes
, @NonNull final String pattern
,
748 @NonNull final Locale locale
) {
749 return formatAsGibibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
753 * @param numberOfBytes
754 * The amount of bytes to format.
756 * The formatting pattern to apply.
759 * @return The formatted bytes using the default pattern.
762 public static String
formatAsGibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
763 @NonNull final Locale locale
) {
764 return formatAsGibibyte(numberOfBytes
, asFormat(pattern
, locale
));
768 * @param numberOfBytes
769 * The amount of bytes to format.
771 * The formatting pattern to apply.
772 * @return The formatted bytes using the default pattern.
775 public static String
formatAsGibibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
776 return formatAsGibibyte(numberOfBytes
.longValue(), format
);
780 * @param numberOfBytes
781 * The amount of bytes to format.
783 * The formatting pattern to apply.
784 * @return The formatted bytes using the default pattern.
787 public static String
formatAsGibibyte(final long numberOfBytes
, @NonNull final Format format
) {
788 return formatAsGibibyte(asBigInteger(numberOfBytes
), format
);
792 * @param numberOfBytes
793 * The amount of bytes to format.
795 * The formatting pattern to apply.
796 * @return The formatted bytes using the default pattern.
799 public static String
formatAsGibibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
800 return Gibibyte
.valueOf(numberOfBytes
).toString(format
);
804 * @param numberOfBytes
805 * The amount of bytes to format.
806 * @return The formatted bytes using the default pattern.
809 public static String
formatAsTebibyte(@NonNull final Long numberOfBytes
) {
810 return formatAsTebibyte(numberOfBytes
.longValue());
814 * @param numberOfBytes
815 * The amount of bytes to format.
816 * @return The formatted bytes using the default pattern.
819 public static String
formatAsTebibyte(final long numberOfBytes
) {
820 return formatAsTebibyte(asBigInteger(numberOfBytes
));
824 * @param numberOfBytes
825 * The amount of bytes to format.
826 * @return The formatted bytes using the default pattern.
829 public static String
formatAsTebibyte(@NonNull final BigInteger numberOfBytes
) {
830 return formatAsTebibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
834 * @param numberOfBytes
835 * The amount of bytes to format.
837 * The formatting pattern to apply.
838 * @return The formatted bytes using the default pattern.
841 public static String
formatAsTebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
842 return formatAsTebibyte(numberOfBytes
.longValue(), pattern
);
846 * @param numberOfBytes
847 * The amount of bytes to format.
849 * The formatting pattern to apply.
850 * @return The formatted bytes using the default pattern.
853 public static String
formatAsTebibyte(final long numberOfBytes
, @NonNull final String pattern
) {
854 return formatAsTebibyte(asBigInteger(numberOfBytes
), pattern
);
858 * @param numberOfBytes
859 * The amount of bytes to format.
861 * The formatting pattern to apply.
862 * @return The formatted bytes using the default pattern.
865 public static String
formatAsTebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
866 return formatAsTebibyte(numberOfBytes
, new DecimalFormat(pattern
));
870 * @param numberOfBytes
871 * The amount of bytes to format.
873 * The formatting pattern to apply.
876 * @return The formatted bytes using the default pattern.
879 public static String
formatAsTebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
880 @NonNull final Locale locale
) {
881 return formatAsTebibyte(numberOfBytes
.longValue(), pattern
, locale
);
885 * @param numberOfBytes
886 * The amount of bytes to format.
888 * The formatting pattern to apply.
891 * @return The formatted bytes using the default pattern.
894 public static String
formatAsTebibyte(final long numberOfBytes
, @NonNull final String pattern
,
895 @NonNull final Locale locale
) {
896 return formatAsTebibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
900 * @param numberOfBytes
901 * The amount of bytes to format.
903 * The formatting pattern to apply.
906 * @return The formatted bytes using the default pattern.
909 public static String
formatAsTebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
910 @NonNull final Locale locale
) {
911 return formatAsTebibyte(numberOfBytes
, asFormat(pattern
, locale
));
915 * @param numberOfBytes
916 * The amount of bytes to format.
918 * The formatting pattern to apply.
919 * @return The formatted bytes using the default pattern.
922 public static String
formatAsTebibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
923 return formatAsTebibyte(numberOfBytes
.longValue(), format
);
927 * @param numberOfBytes
928 * The amount of bytes to format.
930 * The formatting pattern to apply.
931 * @return The formatted bytes using the default pattern.
934 public static String
formatAsTebibyte(final long numberOfBytes
, @NonNull final Format format
) {
935 return formatAsTebibyte(asBigInteger(numberOfBytes
), format
);
939 * @param numberOfBytes
940 * The amount of bytes to format.
942 * The formatting pattern to apply.
943 * @return The formatted bytes using the default pattern.
946 public static String
formatAsTebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
947 return Tebibyte
.valueOf(numberOfBytes
).toString(format
);
951 * @param numberOfBytes
952 * The amount of bytes to format.
953 * @return The formatted bytes using the default pattern.
956 public static String
formatAsPebibyte(@NonNull final Long numberOfBytes
) {
957 return formatAsPebibyte(numberOfBytes
.longValue());
961 * @param numberOfBytes
962 * The amount of bytes to format.
963 * @return The formatted bytes using the default pattern.
966 public static String
formatAsPebibyte(final long numberOfBytes
) {
967 return formatAsPebibyte(asBigInteger(numberOfBytes
));
971 * @param numberOfBytes
972 * The amount of bytes to format.
973 * @return The formatted bytes using the default pattern.
976 public static String
formatAsPebibyte(@NonNull final BigInteger numberOfBytes
) {
977 return formatAsPebibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
981 * @param numberOfBytes
982 * The amount of bytes to format.
984 * The formatting pattern to apply.
985 * @return The formatted bytes using the default pattern.
988 public static String
formatAsPebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
989 return formatAsPebibyte(numberOfBytes
.longValue(), pattern
);
993 * @param numberOfBytes
994 * The amount of bytes to format.
996 * The formatting pattern to apply.
997 * @return The formatted bytes using the default pattern.
1000 public static String
formatAsPebibyte(final long numberOfBytes
, @NonNull final String pattern
) {
1001 return formatAsPebibyte(asBigInteger(numberOfBytes
), pattern
);
1005 * @param numberOfBytes
1006 * The amount of bytes to format.
1008 * The formatting pattern to apply.
1009 * @return The formatted bytes using the default pattern.
1012 public static String
formatAsPebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1013 return formatAsPebibyte(numberOfBytes
, new DecimalFormat(pattern
));
1017 * @param numberOfBytes
1018 * The amount of bytes to format.
1020 * The formatting pattern to apply.
1022 * The locale to use.
1023 * @return The formatted bytes using the default pattern.
1026 public static String
formatAsPebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1027 @NonNull final Locale locale
) {
1028 return formatAsPebibyte(numberOfBytes
.longValue(), pattern
, locale
);
1032 * @param numberOfBytes
1033 * The amount of bytes to format.
1035 * The formatting pattern to apply.
1037 * The locale to use.
1038 * @return The formatted bytes using the default pattern.
1041 public static String
formatAsPebibyte(final long numberOfBytes
, @NonNull final String pattern
,
1042 @NonNull final Locale locale
) {
1043 return formatAsPebibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1047 * @param numberOfBytes
1048 * The amount of bytes to format.
1050 * The formatting pattern to apply.
1052 * The locale to use.
1053 * @return The formatted bytes using the default pattern.
1056 public static String
formatAsPebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1057 @NonNull final Locale locale
) {
1058 return formatAsPebibyte(numberOfBytes
, asFormat(pattern
, locale
));
1062 * @param numberOfBytes
1063 * The amount of bytes to format.
1065 * The formatting pattern to apply.
1066 * @return The formatted bytes using the default pattern.
1069 public static String
formatAsPebibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1070 return formatAsPebibyte(numberOfBytes
.longValue(), format
);
1074 * @param numberOfBytes
1075 * The amount of bytes to format.
1077 * The formatting pattern to apply.
1078 * @return The formatted bytes using the default pattern.
1081 public static String
formatAsPebibyte(final long numberOfBytes
, @NonNull final Format format
) {
1082 return formatAsPebibyte(asBigInteger(numberOfBytes
), format
);
1086 * @param numberOfBytes
1087 * The amount of bytes to format.
1089 * The formatting pattern to apply.
1090 * @return The formatted bytes using the default pattern.
1093 public static String
formatAsPebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1094 return Pebibyte
.valueOf(numberOfBytes
).toString(format
);
1098 * @param numberOfBytes
1099 * The amount of bytes to format.
1100 * @return The formatted bytes using the default pattern.
1103 public static String
formatAsExbibyte(@NonNull final Long numberOfBytes
) {
1104 return formatAsExbibyte(numberOfBytes
.longValue());
1108 * @param numberOfBytes
1109 * The amount of bytes to format.
1110 * @return The formatted bytes using the default pattern.
1113 public static String
formatAsExbibyte(final long numberOfBytes
) {
1114 return formatAsExbibyte(asBigInteger(numberOfBytes
));
1118 * @param numberOfBytes
1119 * The amount of bytes to format.
1120 * @return The formatted bytes using the default pattern.
1123 public static String
formatAsExbibyte(@NonNull final BigInteger numberOfBytes
) {
1124 return formatAsExbibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1128 * @param numberOfBytes
1129 * The amount of bytes to format.
1131 * The formatting pattern to apply.
1132 * @return The formatted bytes using the default pattern.
1135 public static String
formatAsExbibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1136 return formatAsExbibyte(numberOfBytes
.longValue(), pattern
);
1140 * @param numberOfBytes
1141 * The amount of bytes to format.
1143 * The formatting pattern to apply.
1144 * @return The formatted bytes using the default pattern.
1147 public static String
formatAsExbibyte(final long numberOfBytes
, @NonNull final String pattern
) {
1148 return formatAsExbibyte(asBigInteger(numberOfBytes
), pattern
);
1152 * @param numberOfBytes
1153 * The amount of bytes to format.
1155 * The formatting pattern to apply.
1156 * @return The formatted bytes using the default pattern.
1159 public static String
formatAsExbibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1160 return formatAsExbibyte(numberOfBytes
, new DecimalFormat(pattern
));
1164 * @param numberOfBytes
1165 * The amount of bytes to format.
1167 * The formatting pattern to apply.
1169 * The locale to use.
1170 * @return The formatted bytes using the default pattern.
1173 public static String
formatAsExbibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1174 @NonNull final Locale locale
) {
1175 return formatAsExbibyte(numberOfBytes
.longValue(), pattern
, locale
);
1179 * @param numberOfBytes
1180 * The amount of bytes to format.
1182 * The formatting pattern to apply.
1184 * The locale to use.
1185 * @return The formatted bytes using the default pattern.
1188 public static String
formatAsExbibyte(final long numberOfBytes
, @NonNull final String pattern
,
1189 @NonNull final Locale locale
) {
1190 return formatAsExbibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1194 * @param numberOfBytes
1195 * The amount of bytes to format.
1197 * The formatting pattern to apply.
1199 * The locale to use.
1200 * @return The formatted bytes using the default pattern.
1203 public static String
formatAsExbibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1204 @NonNull final Locale locale
) {
1205 return formatAsExbibyte(numberOfBytes
, asFormat(pattern
, locale
));
1209 * @param numberOfBytes
1210 * The amount of bytes to format.
1212 * The formatting pattern to apply.
1213 * @return The formatted bytes using the default pattern.
1216 public static String
formatAsExbibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1217 return formatAsExbibyte(numberOfBytes
.longValue(), format
);
1221 * @param numberOfBytes
1222 * The amount of bytes to format.
1224 * The formatting pattern to apply.
1225 * @return The formatted bytes using the default pattern.
1228 public static String
formatAsExbibyte(final long numberOfBytes
, @NonNull final Format format
) {
1229 return formatAsExbibyte(asBigInteger(numberOfBytes
), format
);
1233 * @param numberOfBytes
1234 * The amount of bytes to format.
1236 * The formatting pattern to apply.
1237 * @return The formatted bytes using the default pattern.
1240 public static String
formatAsExbibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1241 return Exbibyte
.valueOf(numberOfBytes
).toString(format
);
1245 * @param numberOfBytes
1246 * The amount of bytes to format.
1247 * @return The formatted bytes using the default pattern.
1250 public static String
formatAsZebibyte(@NonNull final Long numberOfBytes
) {
1251 return formatAsZebibyte(numberOfBytes
.longValue());
1255 * @param numberOfBytes
1256 * The amount of bytes to format.
1257 * @return The formatted bytes using the default pattern.
1260 public static String
formatAsZebibyte(final long numberOfBytes
) {
1261 return formatAsZebibyte(asBigInteger(numberOfBytes
));
1265 * @param numberOfBytes
1266 * The amount of bytes to format.
1267 * @return The formatted bytes using the default pattern.
1270 public static String
formatAsZebibyte(@NonNull final BigInteger numberOfBytes
) {
1271 return formatAsZebibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1275 * @param numberOfBytes
1276 * The amount of bytes to format.
1278 * The formatting pattern to apply.
1279 * @return The formatted bytes using the default pattern.
1282 public static String
formatAsZebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1283 return formatAsZebibyte(numberOfBytes
.longValue(), pattern
);
1287 * @param numberOfBytes
1288 * The amount of bytes to format.
1290 * The formatting pattern to apply.
1291 * @return The formatted bytes using the default pattern.
1294 public static String
formatAsZebibyte(final long numberOfBytes
, @NonNull final String pattern
) {
1295 return formatAsZebibyte(asBigInteger(numberOfBytes
), pattern
);
1299 * @param numberOfBytes
1300 * The amount of bytes to format.
1302 * The formatting pattern to apply.
1303 * @return The formatted bytes using the default pattern.
1306 public static String
formatAsZebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1307 return formatAsZebibyte(numberOfBytes
, new DecimalFormat(pattern
));
1311 * @param numberOfBytes
1312 * The amount of bytes to format.
1314 * The formatting pattern to apply.
1316 * The locale to use.
1317 * @return The formatted bytes using the default pattern.
1320 public static String
formatAsZebibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1321 @NonNull final Locale locale
) {
1322 return formatAsZebibyte(numberOfBytes
.longValue(), pattern
, locale
);
1326 * @param numberOfBytes
1327 * The amount of bytes to format.
1329 * The formatting pattern to apply.
1331 * The locale to use.
1332 * @return The formatted bytes using the default pattern.
1335 public static String
formatAsZebibyte(final long numberOfBytes
, @NonNull final String pattern
,
1336 @NonNull final Locale locale
) {
1337 return formatAsZebibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1341 * @param numberOfBytes
1342 * The amount of bytes to format.
1344 * The formatting pattern to apply.
1346 * The locale to use.
1347 * @return The formatted bytes using the default pattern.
1350 public static String
formatAsZebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1351 @NonNull final Locale locale
) {
1352 return formatAsZebibyte(numberOfBytes
, asFormat(pattern
, locale
));
1356 * @param numberOfBytes
1357 * The amount of bytes to format.
1359 * The formatting pattern to apply.
1360 * @return The formatted bytes using the default pattern.
1363 public static String
formatAsZebibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1364 return formatAsZebibyte(numberOfBytes
.longValue(), format
);
1368 * @param numberOfBytes
1369 * The amount of bytes to format.
1371 * The formatting pattern to apply.
1372 * @return The formatted bytes using the default pattern.
1375 public static String
formatAsZebibyte(final long numberOfBytes
, @NonNull final Format format
) {
1376 return formatAsZebibyte(asBigInteger(numberOfBytes
), format
);
1380 * @param numberOfBytes
1381 * The amount of bytes to format.
1383 * The formatting pattern to apply.
1384 * @return The formatted bytes using the default pattern.
1387 public static String
formatAsZebibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1388 return Zebibyte
.valueOf(numberOfBytes
).toString(format
);
1392 * @param numberOfBytes
1393 * The amount of bytes to format.
1394 * @return The formatted bytes using the default pattern.
1397 public static String
formatAsYobibyte(@NonNull final Long numberOfBytes
) {
1398 return formatAsYobibyte(numberOfBytes
.longValue());
1402 * @param numberOfBytes
1403 * The amount of bytes to format.
1404 * @return The formatted bytes using the default pattern.
1407 public static String
formatAsYobibyte(final long numberOfBytes
) {
1408 return formatAsYobibyte(asBigInteger(numberOfBytes
));
1412 * @param numberOfBytes
1413 * The amount of bytes to format.
1414 * @return The formatted bytes using the default pattern.
1417 public static String
formatAsYobibyte(@NonNull final BigInteger numberOfBytes
) {
1418 return formatAsYobibyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1422 * @param numberOfBytes
1423 * The amount of bytes to format.
1425 * The formatting pattern to apply.
1426 * @return The formatted bytes using the default pattern.
1429 public static String
formatAsYobibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1430 return formatAsYobibyte(numberOfBytes
.longValue(), pattern
);
1434 * @param numberOfBytes
1435 * The amount of bytes to format.
1437 * The formatting pattern to apply.
1438 * @return The formatted bytes using the default pattern.
1441 public static String
formatAsYobibyte(final long numberOfBytes
, @NonNull final String pattern
) {
1442 return formatAsYobibyte(asBigInteger(numberOfBytes
), pattern
);
1446 * @param numberOfBytes
1447 * The amount of bytes to format.
1449 * The formatting pattern to apply.
1450 * @return The formatted bytes using the default pattern.
1453 public static String
formatAsYobibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1454 return formatAsYobibyte(numberOfBytes
, new DecimalFormat(pattern
));
1458 * @param numberOfBytes
1459 * The amount of bytes to format.
1461 * The formatting pattern to apply.
1463 * The locale to use.
1464 * @return The formatted bytes using the default pattern.
1467 public static String
formatAsYobibyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1468 @NonNull final Locale locale
) {
1469 return formatAsYobibyte(numberOfBytes
.longValue(), pattern
, locale
);
1473 * @param numberOfBytes
1474 * The amount of bytes to format.
1476 * The formatting pattern to apply.
1478 * The locale to use.
1479 * @return The formatted bytes using the default pattern.
1482 public static String
formatAsYobibyte(final long numberOfBytes
, @NonNull final String pattern
,
1483 @NonNull final Locale locale
) {
1484 return formatAsYobibyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1488 * @param numberOfBytes
1489 * The amount of bytes to format.
1491 * The formatting pattern to apply.
1493 * The locale to use.
1494 * @return The formatted bytes using the default pattern.
1497 public static String
formatAsYobibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1498 @NonNull final Locale locale
) {
1499 return formatAsYobibyte(numberOfBytes
, asFormat(pattern
, locale
));
1503 * @param numberOfBytes
1504 * The amount of bytes to format.
1506 * The formatting pattern to apply.
1507 * @return The formatted bytes using the default pattern.
1510 public static String
formatAsYobibyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1511 return formatAsYobibyte(numberOfBytes
.longValue(), format
);
1515 * @param numberOfBytes
1516 * The amount of bytes to format.
1518 * The formatting pattern to apply.
1519 * @return The formatted bytes using the default pattern.
1522 public static String
formatAsYobibyte(final long numberOfBytes
, @NonNull final Format format
) {
1523 return formatAsYobibyte(asBigInteger(numberOfBytes
), format
);
1527 * @param numberOfBytes
1528 * The amount of bytes to format.
1530 * The formatting pattern to apply.
1531 * @return The formatted bytes using the default pattern.
1534 public static String
formatAsYobibyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1535 return Yobibyte
.valueOf(numberOfBytes
).toString(format
);
1539 * @param numberOfBytes
1540 * The amount of bytes to format.
1541 * @return The formatted bytes using the default pattern.
1544 public static String
formatAsMetricUnit(@NonNull final Long numberOfBytes
) {
1545 return formatAsMetricUnit(numberOfBytes
.longValue());
1549 * @param numberOfBytes
1550 * The amount of bytes to format.
1551 * @return The formatted bytes using the default pattern.
1554 public static String
formatAsMetricUnit(final long numberOfBytes
) {
1555 return formatAsMetricUnit(asBigInteger(numberOfBytes
));
1559 * @param numberOfBytes
1560 * The amount of bytes to format.
1561 * @return The formatted bytes using the default pattern.
1564 public static String
formatAsMetricUnit(@NonNull final BigInteger numberOfBytes
) {
1565 return formatAsMetricUnit(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1569 * @param numberOfBytes
1570 * The amount of bytes to format.
1572 * The formatting pattern to apply.
1573 * @return The formatted bytes using the default pattern.
1576 public static String
formatAsMetricUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1577 return formatAsMetricUnit(numberOfBytes
.longValue(), pattern
);
1581 * @param numberOfBytes
1582 * The amount of bytes to format.
1584 * The formatting pattern to apply.
1585 * @return The formatted bytes using the default pattern.
1588 public static String
formatAsMetricUnit(final long numberOfBytes
, @NonNull final String pattern
) {
1589 return formatAsMetricUnit(asBigInteger(numberOfBytes
), pattern
);
1593 * @param numberOfBytes
1594 * The amount of bytes to format.
1596 * The formatting pattern to apply.
1597 * @return The formatted bytes using the default pattern.
1600 public static String
formatAsMetricUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1601 return formatAsMetricUnit(numberOfBytes
, new DecimalFormat(pattern
));
1605 * @param numberOfBytes
1606 * The amount of bytes to format.
1608 * The formatting pattern to apply.
1610 * The locale to use.
1611 * @return The formatted bytes using the default pattern.
1614 public static String
formatAsMetricUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1615 @NonNull final Locale locale
) {
1616 return formatAsMetricUnit(numberOfBytes
.longValue(), pattern
, locale
);
1620 * @param numberOfBytes
1621 * The amount of bytes to format.
1623 * The formatting pattern to apply.
1625 * The locale to use.
1626 * @return The formatted bytes using the default pattern.
1629 public static String
formatAsMetricUnit(final long numberOfBytes
, @NonNull final String pattern
,
1630 @NonNull final Locale locale
) {
1631 return formatAsMetricUnit(asBigInteger(numberOfBytes
), pattern
, locale
);
1635 * @param numberOfBytes
1636 * The amount of bytes to format.
1638 * The formatting pattern to apply.
1640 * The locale to use.
1641 * @return The formatted bytes using the default pattern.
1644 public static String
formatAsMetricUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1645 @NonNull final Locale locale
) {
1646 return formatAsMetricUnit(numberOfBytes
, asFormat(pattern
, locale
));
1650 * @param numberOfBytes
1651 * The amount of bytes to format.
1653 * The formatting pattern to apply.
1654 * @return The formatted bytes using the default pattern.
1657 public static String
formatAsMetricUnit(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1658 return formatAsMetricUnit(numberOfBytes
.longValue(), format
);
1662 * @param numberOfBytes
1663 * The amount of bytes to format.
1665 * The formatting pattern to apply.
1666 * @return The formatted bytes using the default pattern.
1669 public static String
formatAsMetricUnit(final long numberOfBytes
, @NonNull final Format format
) {
1670 return formatAsMetricUnit(asBigInteger(numberOfBytes
), format
);
1674 * @param numberOfBytes
1675 * The amount of bytes to format.
1677 * The formatting pattern to apply.
1678 * @return The formatted bytes using the default pattern.
1681 public static String
formatAsMetricUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1682 return metricValueOf(numberOfBytes
).toString(format
);
1686 * @param numberOfBytes
1687 * The amount of bytes to format.
1688 * @return The formatted bytes using the default pattern.
1691 public static String
formatAsKilobyte(@NonNull final Long numberOfBytes
) {
1692 return formatAsKilobyte(numberOfBytes
.longValue());
1696 * @param numberOfBytes
1697 * The amount of bytes to format.
1698 * @return The formatted bytes using the default pattern.
1701 public static String
formatAsKilobyte(final long numberOfBytes
) {
1702 return formatAsKilobyte(asBigInteger(numberOfBytes
));
1706 * @param numberOfBytes
1707 * The amount of bytes to format.
1708 * @return The formatted bytes using the default pattern.
1711 public static String
formatAsKilobyte(@NonNull final BigInteger numberOfBytes
) {
1712 return formatAsKilobyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1716 * @param numberOfBytes
1717 * The amount of bytes to format.
1719 * The formatting pattern to apply.
1720 * @return The formatted bytes using the default pattern.
1723 public static String
formatAsKilobyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1724 return formatAsKilobyte(numberOfBytes
.longValue(), pattern
);
1728 * @param numberOfBytes
1729 * The amount of bytes to format.
1731 * The formatting pattern to apply.
1732 * @return The formatted bytes using the default pattern.
1735 public static String
formatAsKilobyte(final long numberOfBytes
, @NonNull final String pattern
) {
1736 return formatAsKilobyte(asBigInteger(numberOfBytes
), pattern
);
1740 * @param numberOfBytes
1741 * The amount of bytes to format.
1743 * The formatting pattern to apply.
1744 * @return The formatted bytes using the default pattern.
1747 public static String
formatAsKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1748 return formatAsKilobyte(numberOfBytes
, new DecimalFormat(pattern
));
1752 * @param numberOfBytes
1753 * The amount of bytes to format.
1755 * The formatting pattern to apply.
1757 * The locale to use.
1758 * @return The formatted bytes using the default pattern.
1761 public static String
formatAsKilobyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1762 @NonNull final Locale locale
) {
1763 return formatAsKilobyte(numberOfBytes
.longValue(), pattern
, locale
);
1767 * @param numberOfBytes
1768 * The amount of bytes to format.
1770 * The formatting pattern to apply.
1772 * The locale to use.
1773 * @return The formatted bytes using the default pattern.
1776 public static String
formatAsKilobyte(final long numberOfBytes
, @NonNull final String pattern
,
1777 @NonNull final Locale locale
) {
1778 return formatAsKilobyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1782 * @param numberOfBytes
1783 * The amount of bytes to format.
1785 * The formatting pattern to apply.
1787 * The locale to use.
1788 * @return The formatted bytes using the default pattern.
1791 public static String
formatAsKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1792 @NonNull final Locale locale
) {
1793 return formatAsKilobyte(numberOfBytes
, asFormat(pattern
, locale
));
1797 * @param numberOfBytes
1798 * The amount of bytes to format.
1800 * The formatting pattern to apply.
1801 * @return The formatted bytes using the default pattern.
1804 public static String
formatAsKilobyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1805 return formatAsKilobyte(numberOfBytes
.longValue(), format
);
1809 * @param numberOfBytes
1810 * The amount of bytes to format.
1812 * The formatting pattern to apply.
1813 * @return The formatted bytes using the default pattern.
1816 public static String
formatAsKilobyte(final long numberOfBytes
, @NonNull final Format format
) {
1817 return formatAsKilobyte(asBigInteger(numberOfBytes
), format
);
1821 * @param numberOfBytes
1822 * The amount of bytes to format.
1824 * The formatting pattern to apply.
1825 * @return The formatted bytes using the default pattern.
1828 public static String
formatAsKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1829 return Kilobyte
.valueOf(numberOfBytes
).toString(format
);
1833 * @param numberOfBytes
1834 * The amount of bytes to format.
1835 * @return The formatted bytes using the default pattern.
1838 public static String
formatAsMegabyte(@NonNull final Long numberOfBytes
) {
1839 return formatAsMegabyte(numberOfBytes
.longValue());
1843 * @param numberOfBytes
1844 * The amount of bytes to format.
1845 * @return The formatted bytes using the default pattern.
1848 public static String
formatAsMegabyte(final long numberOfBytes
) {
1849 return formatAsMegabyte(asBigInteger(numberOfBytes
));
1853 * @param numberOfBytes
1854 * The amount of bytes to format.
1855 * @return The formatted bytes using the default pattern.
1858 public static String
formatAsMegabyte(@NonNull final BigInteger numberOfBytes
) {
1859 return formatAsMegabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
1863 * @param numberOfBytes
1864 * The amount of bytes to format.
1866 * The formatting pattern to apply.
1867 * @return The formatted bytes using the default pattern.
1870 public static String
formatAsMegabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
1871 return formatAsMegabyte(numberOfBytes
.longValue(), pattern
);
1875 * @param numberOfBytes
1876 * The amount of bytes to format.
1878 * The formatting pattern to apply.
1879 * @return The formatted bytes using the default pattern.
1882 public static String
formatAsMegabyte(final long numberOfBytes
, @NonNull final String pattern
) {
1883 return formatAsMegabyte(asBigInteger(numberOfBytes
), pattern
);
1887 * @param numberOfBytes
1888 * The amount of bytes to format.
1890 * The formatting pattern to apply.
1891 * @return The formatted bytes using the default pattern.
1894 public static String
formatAsMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
1895 return formatAsMegabyte(numberOfBytes
, new DecimalFormat(pattern
));
1899 * @param numberOfBytes
1900 * The amount of bytes to format.
1902 * The formatting pattern to apply.
1904 * The locale to use.
1905 * @return The formatted bytes using the default pattern.
1908 public static String
formatAsMegabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
1909 @NonNull final Locale locale
) {
1910 return formatAsMegabyte(numberOfBytes
.longValue(), pattern
, locale
);
1914 * @param numberOfBytes
1915 * The amount of bytes to format.
1917 * The formatting pattern to apply.
1919 * The locale to use.
1920 * @return The formatted bytes using the default pattern.
1923 public static String
formatAsMegabyte(final long numberOfBytes
, @NonNull final String pattern
,
1924 @NonNull final Locale locale
) {
1925 return formatAsMegabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
1929 * @param numberOfBytes
1930 * The amount of bytes to format.
1932 * The formatting pattern to apply.
1934 * The locale to use.
1935 * @return The formatted bytes using the default pattern.
1938 public static String
formatAsMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
1939 @NonNull final Locale locale
) {
1940 return formatAsMegabyte(numberOfBytes
, asFormat(pattern
, locale
));
1944 * @param numberOfBytes
1945 * The amount of bytes to format.
1947 * The formatting pattern to apply.
1948 * @return The formatted bytes using the default pattern.
1951 public static String
formatAsMegabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
1952 return formatAsMegabyte(numberOfBytes
.longValue(), format
);
1956 * @param numberOfBytes
1957 * The amount of bytes to format.
1959 * The formatting pattern to apply.
1960 * @return The formatted bytes using the default pattern.
1963 public static String
formatAsMegabyte(final long numberOfBytes
, @NonNull final Format format
) {
1964 return formatAsMegabyte(asBigInteger(numberOfBytes
), format
);
1968 * @param numberOfBytes
1969 * The amount of bytes to format.
1971 * The formatting pattern to apply.
1972 * @return The formatted bytes using the default pattern.
1975 public static String
formatAsMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
1976 return Megabyte
.valueOf(numberOfBytes
).toString(format
);
1980 * @param numberOfBytes
1981 * The amount of bytes to format.
1982 * @return The formatted bytes using the default pattern.
1985 public static String
formatAsGigabyte(@NonNull final Long numberOfBytes
) {
1986 return formatAsGigabyte(numberOfBytes
.longValue());
1990 * @param numberOfBytes
1991 * The amount of bytes to format.
1992 * @return The formatted bytes using the default pattern.
1995 public static String
formatAsGigabyte(final long numberOfBytes
) {
1996 return formatAsGigabyte(asBigInteger(numberOfBytes
));
2000 * @param numberOfBytes
2001 * The amount of bytes to format.
2002 * @return The formatted bytes using the default pattern.
2005 public static String
formatAsGigabyte(@NonNull final BigInteger numberOfBytes
) {
2006 return formatAsGigabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2010 * @param numberOfBytes
2011 * The amount of bytes to format.
2013 * The formatting pattern to apply.
2014 * @return The formatted bytes using the default pattern.
2017 public static String
formatAsGigabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2018 return formatAsGigabyte(numberOfBytes
.longValue(), pattern
);
2022 * @param numberOfBytes
2023 * The amount of bytes to format.
2025 * The formatting pattern to apply.
2026 * @return The formatted bytes using the default pattern.
2029 public static String
formatAsGigabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2030 return formatAsGigabyte(asBigInteger(numberOfBytes
), pattern
);
2034 * @param numberOfBytes
2035 * The amount of bytes to format.
2037 * The formatting pattern to apply.
2038 * @return The formatted bytes using the default pattern.
2041 public static String
formatAsGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2042 return formatAsGigabyte(numberOfBytes
, new DecimalFormat(pattern
));
2046 * @param numberOfBytes
2047 * The amount of bytes to format.
2049 * The formatting pattern to apply.
2051 * The locale to use.
2052 * @return The formatted bytes using the default pattern.
2055 public static String
formatAsGigabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2056 @NonNull final Locale locale
) {
2057 return formatAsGigabyte(numberOfBytes
.longValue(), pattern
, locale
);
2061 * @param numberOfBytes
2062 * The amount of bytes to format.
2064 * The formatting pattern to apply.
2066 * The locale to use.
2067 * @return The formatted bytes using the default pattern.
2070 public static String
formatAsGigabyte(final long numberOfBytes
, @NonNull final String pattern
,
2071 @NonNull final Locale locale
) {
2072 return formatAsGigabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2076 * @param numberOfBytes
2077 * The amount of bytes to format.
2079 * The formatting pattern to apply.
2081 * The locale to use.
2082 * @return The formatted bytes using the default pattern.
2085 public static String
formatAsGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2086 @NonNull final Locale locale
) {
2087 return formatAsGigabyte(numberOfBytes
, asFormat(pattern
, locale
));
2091 * @param numberOfBytes
2092 * The amount of bytes to format.
2094 * The formatting pattern to apply.
2095 * @return The formatted bytes using the default pattern.
2098 public static String
formatAsGigabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2099 return formatAsGigabyte(numberOfBytes
.longValue(), format
);
2103 * @param numberOfBytes
2104 * The amount of bytes to format.
2106 * The formatting pattern to apply.
2107 * @return The formatted bytes using the default pattern.
2110 public static String
formatAsGigabyte(final long numberOfBytes
, @NonNull final Format format
) {
2111 return formatAsGigabyte(asBigInteger(numberOfBytes
), format
);
2115 * @param numberOfBytes
2116 * The amount of bytes to format.
2118 * The formatting pattern to apply.
2119 * @return The formatted bytes using the default pattern.
2122 public static String
formatAsGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2123 return Gigabyte
.valueOf(numberOfBytes
).toString(format
);
2127 * @param numberOfBytes
2128 * The amount of bytes to format.
2129 * @return The formatted bytes using the default pattern.
2132 public static String
formatAsTerabyte(@NonNull final Long numberOfBytes
) {
2133 return formatAsTerabyte(numberOfBytes
.longValue());
2137 * @param numberOfBytes
2138 * The amount of bytes to format.
2139 * @return The formatted bytes using the default pattern.
2142 public static String
formatAsTerabyte(final long numberOfBytes
) {
2143 return formatAsTerabyte(asBigInteger(numberOfBytes
));
2147 * @param numberOfBytes
2148 * The amount of bytes to format.
2149 * @return The formatted bytes using the default pattern.
2152 public static String
formatAsTerabyte(@NonNull final BigInteger numberOfBytes
) {
2153 return formatAsTerabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2157 * @param numberOfBytes
2158 * The amount of bytes to format.
2160 * The formatting pattern to apply.
2161 * @return The formatted bytes using the default pattern.
2164 public static String
formatAsTerabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2165 return formatAsTerabyte(numberOfBytes
.longValue(), pattern
);
2169 * @param numberOfBytes
2170 * The amount of bytes to format.
2172 * The formatting pattern to apply.
2173 * @return The formatted bytes using the default pattern.
2176 public static String
formatAsTerabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2177 return formatAsTerabyte(asBigInteger(numberOfBytes
), pattern
);
2181 * @param numberOfBytes
2182 * The amount of bytes to format.
2184 * The formatting pattern to apply.
2185 * @return The formatted bytes using the default pattern.
2188 public static String
formatAsTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2189 return formatAsTerabyte(numberOfBytes
, new DecimalFormat(pattern
));
2193 * @param numberOfBytes
2194 * The amount of bytes to format.
2196 * The formatting pattern to apply.
2198 * The locale to use.
2199 * @return The formatted bytes using the default pattern.
2202 public static String
formatAsTerabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2203 @NonNull final Locale locale
) {
2204 return formatAsTerabyte(numberOfBytes
.longValue(), pattern
, locale
);
2208 * @param numberOfBytes
2209 * The amount of bytes to format.
2211 * The formatting pattern to apply.
2213 * The locale to use.
2214 * @return The formatted bytes using the default pattern.
2217 public static String
formatAsTerabyte(final long numberOfBytes
, @NonNull final String pattern
,
2218 @NonNull final Locale locale
) {
2219 return formatAsTerabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2223 * @param numberOfBytes
2224 * The amount of bytes to format.
2226 * The formatting pattern to apply.
2228 * The locale to use.
2229 * @return The formatted bytes using the default pattern.
2232 public static String
formatAsTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2233 @NonNull final Locale locale
) {
2234 return formatAsTerabyte(numberOfBytes
, asFormat(pattern
, locale
));
2238 * @param numberOfBytes
2239 * The amount of bytes to format.
2241 * The formatting pattern to apply.
2242 * @return The formatted bytes using the default pattern.
2245 public static String
formatAsTerabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2246 return formatAsTerabyte(numberOfBytes
.longValue(), format
);
2250 * @param numberOfBytes
2251 * The amount of bytes to format.
2253 * The formatting pattern to apply.
2254 * @return The formatted bytes using the default pattern.
2257 public static String
formatAsTerabyte(final long numberOfBytes
, @NonNull final Format format
) {
2258 return formatAsTerabyte(asBigInteger(numberOfBytes
), format
);
2262 * @param numberOfBytes
2263 * The amount of bytes to format.
2265 * The formatting pattern to apply.
2266 * @return The formatted bytes using the default pattern.
2269 public static String
formatAsTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2270 return Terabyte
.valueOf(numberOfBytes
).toString(format
);
2274 * @param numberOfBytes
2275 * The amount of bytes to format.
2276 * @return The formatted bytes using the default pattern.
2279 public static String
formatAsPetabyte(@NonNull final Long numberOfBytes
) {
2280 return formatAsPetabyte(numberOfBytes
.longValue());
2284 * @param numberOfBytes
2285 * The amount of bytes to format.
2286 * @return The formatted bytes using the default pattern.
2289 public static String
formatAsPetabyte(final long numberOfBytes
) {
2290 return formatAsPetabyte(asBigInteger(numberOfBytes
));
2294 * @param numberOfBytes
2295 * The amount of bytes to format.
2296 * @return The formatted bytes using the default pattern.
2299 public static String
formatAsPetabyte(@NonNull final BigInteger numberOfBytes
) {
2300 return formatAsPetabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2304 * @param numberOfBytes
2305 * The amount of bytes to format.
2307 * The formatting pattern to apply.
2308 * @return The formatted bytes using the default pattern.
2311 public static String
formatAsPetabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2312 return formatAsPetabyte(numberOfBytes
.longValue(), pattern
);
2316 * @param numberOfBytes
2317 * The amount of bytes to format.
2319 * The formatting pattern to apply.
2320 * @return The formatted bytes using the default pattern.
2323 public static String
formatAsPetabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2324 return formatAsPetabyte(asBigInteger(numberOfBytes
), pattern
);
2328 * @param numberOfBytes
2329 * The amount of bytes to format.
2331 * The formatting pattern to apply.
2332 * @return The formatted bytes using the default pattern.
2335 public static String
formatAsPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2336 return formatAsPetabyte(numberOfBytes
, new DecimalFormat(pattern
));
2340 * @param numberOfBytes
2341 * The amount of bytes to format.
2343 * The formatting pattern to apply.
2345 * The locale to use.
2346 * @return The formatted bytes using the default pattern.
2349 public static String
formatAsPetabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2350 @NonNull final Locale locale
) {
2351 return formatAsPetabyte(numberOfBytes
.longValue(), pattern
, locale
);
2355 * @param numberOfBytes
2356 * The amount of bytes to format.
2358 * The formatting pattern to apply.
2360 * The locale to use.
2361 * @return The formatted bytes using the default pattern.
2364 public static String
formatAsPetabyte(final long numberOfBytes
, @NonNull final String pattern
,
2365 @NonNull final Locale locale
) {
2366 return formatAsPetabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2370 * @param numberOfBytes
2371 * The amount of bytes to format.
2373 * The formatting pattern to apply.
2375 * The locale to use.
2376 * @return The formatted bytes using the default pattern.
2379 public static String
formatAsPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2380 @NonNull final Locale locale
) {
2381 return formatAsPetabyte(numberOfBytes
, asFormat(pattern
, locale
));
2385 * @param numberOfBytes
2386 * The amount of bytes to format.
2388 * The formatting pattern to apply.
2389 * @return The formatted bytes using the default pattern.
2392 public static String
formatAsPetabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2393 return formatAsPetabyte(numberOfBytes
.longValue(), format
);
2397 * @param numberOfBytes
2398 * The amount of bytes to format.
2400 * The formatting pattern to apply.
2401 * @return The formatted bytes using the default pattern.
2404 public static String
formatAsPetabyte(final long numberOfBytes
, @NonNull final Format format
) {
2405 return formatAsPetabyte(asBigInteger(numberOfBytes
), format
);
2409 * @param numberOfBytes
2410 * The amount of bytes to format.
2412 * The formatting pattern to apply.
2413 * @return The formatted bytes using the default pattern.
2416 public static String
formatAsPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2417 return Petabyte
.valueOf(numberOfBytes
).toString(format
);
2421 * @param numberOfBytes
2422 * The amount of bytes to format.
2423 * @return The formatted bytes using the default pattern.
2426 public static String
formatAsExabyte(@NonNull final Long numberOfBytes
) {
2427 return formatAsExabyte(numberOfBytes
.longValue());
2431 * @param numberOfBytes
2432 * The amount of bytes to format.
2433 * @return The formatted bytes using the default pattern.
2436 public static String
formatAsExabyte(final long numberOfBytes
) {
2437 return formatAsExabyte(asBigInteger(numberOfBytes
));
2441 * @param numberOfBytes
2442 * The amount of bytes to format.
2443 * @return The formatted bytes using the default pattern.
2446 public static String
formatAsExabyte(@NonNull final BigInteger numberOfBytes
) {
2447 return formatAsExabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2451 * @param numberOfBytes
2452 * The amount of bytes to format.
2454 * The formatting pattern to apply.
2455 * @return The formatted bytes using the default pattern.
2458 public static String
formatAsExabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2459 return formatAsExabyte(numberOfBytes
.longValue(), pattern
);
2463 * @param numberOfBytes
2464 * The amount of bytes to format.
2466 * The formatting pattern to apply.
2467 * @return The formatted bytes using the default pattern.
2470 public static String
formatAsExabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2471 return formatAsExabyte(asBigInteger(numberOfBytes
), pattern
);
2475 * @param numberOfBytes
2476 * The amount of bytes to format.
2478 * The formatting pattern to apply.
2479 * @return The formatted bytes using the default pattern.
2482 public static String
formatAsExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2483 return formatAsExabyte(numberOfBytes
, new DecimalFormat(pattern
));
2487 * @param numberOfBytes
2488 * The amount of bytes to format.
2490 * The formatting pattern to apply.
2492 * The locale to use.
2493 * @return The formatted bytes using the default pattern.
2496 public static String
formatAsExabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2497 @NonNull final Locale locale
) {
2498 return formatAsExabyte(numberOfBytes
.longValue(), pattern
, locale
);
2502 * @param numberOfBytes
2503 * The amount of bytes to format.
2505 * The formatting pattern to apply.
2507 * The locale to use.
2508 * @return The formatted bytes using the default pattern.
2511 public static String
formatAsExabyte(final long numberOfBytes
, @NonNull final String pattern
,
2512 @NonNull final Locale locale
) {
2513 return formatAsExabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2517 * @param numberOfBytes
2518 * The amount of bytes to format.
2520 * The formatting pattern to apply.
2522 * The locale to use.
2523 * @return The formatted bytes using the default pattern.
2526 public static String
formatAsExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2527 @NonNull final Locale locale
) {
2528 return formatAsExabyte(numberOfBytes
, asFormat(pattern
, locale
));
2532 * @param numberOfBytes
2533 * The amount of bytes to format.
2535 * The formatting pattern to apply.
2536 * @return The formatted bytes using the default pattern.
2539 public static String
formatAsExabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2540 return formatAsExabyte(numberOfBytes
.longValue(), format
);
2544 * @param numberOfBytes
2545 * The amount of bytes to format.
2547 * The formatting pattern to apply.
2548 * @return The formatted bytes using the default pattern.
2551 public static String
formatAsExabyte(final long numberOfBytes
, @NonNull final Format format
) {
2552 return formatAsExabyte(asBigInteger(numberOfBytes
), format
);
2556 * @param numberOfBytes
2557 * The amount of bytes to format.
2559 * The formatting pattern to apply.
2560 * @return The formatted bytes using the default pattern.
2563 public static String
formatAsExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2564 return Exabyte
.valueOf(numberOfBytes
).toString(format
);
2568 * @param numberOfBytes
2569 * The amount of bytes to format.
2570 * @return The formatted bytes using the default pattern.
2573 public static String
formatAsZettabyte(@NonNull final Long numberOfBytes
) {
2574 return formatAsZettabyte(numberOfBytes
.longValue());
2578 * @param numberOfBytes
2579 * The amount of bytes to format.
2580 * @return The formatted bytes using the default pattern.
2583 public static String
formatAsZettabyte(final long numberOfBytes
) {
2584 return formatAsZettabyte(asBigInteger(numberOfBytes
));
2588 * @param numberOfBytes
2589 * The amount of bytes to format.
2590 * @return The formatted bytes using the default pattern.
2593 public static String
formatAsZettabyte(@NonNull final BigInteger numberOfBytes
) {
2594 return formatAsZettabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2598 * @param numberOfBytes
2599 * The amount of bytes to format.
2601 * The formatting pattern to apply.
2602 * @return The formatted bytes using the default pattern.
2605 public static String
formatAsZettabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2606 return formatAsZettabyte(numberOfBytes
.longValue(), pattern
);
2610 * @param numberOfBytes
2611 * The amount of bytes to format.
2613 * The formatting pattern to apply.
2614 * @return The formatted bytes using the default pattern.
2617 public static String
formatAsZettabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2618 return formatAsZettabyte(asBigInteger(numberOfBytes
), pattern
);
2622 * @param numberOfBytes
2623 * The amount of bytes to format.
2625 * The formatting pattern to apply.
2626 * @return The formatted bytes using the default pattern.
2629 public static String
formatAsZettabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2630 return formatAsZettabyte(numberOfBytes
, new DecimalFormat(pattern
));
2634 * @param numberOfBytes
2635 * The amount of bytes to format.
2637 * The formatting pattern to apply.
2639 * The locale to use.
2640 * @return The formatted bytes using the default pattern.
2643 public static String
formatAsZettabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2644 @NonNull final Locale locale
) {
2645 return formatAsZettabyte(numberOfBytes
.longValue(), pattern
, locale
);
2649 * @param numberOfBytes
2650 * The amount of bytes to format.
2652 * The formatting pattern to apply.
2654 * The locale to use.
2655 * @return The formatted bytes using the default pattern.
2658 public static String
formatAsZettabyte(final long numberOfBytes
, @NonNull final String pattern
,
2659 @NonNull final Locale locale
) {
2660 return formatAsZettabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2664 * @param numberOfBytes
2665 * The amount of bytes to format.
2667 * The formatting pattern to apply.
2669 * The locale to use.
2670 * @return The formatted bytes using the default pattern.
2673 public static String
formatAsZettabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2674 @NonNull final Locale locale
) {
2675 return formatAsZettabyte(numberOfBytes
, asFormat(pattern
, locale
));
2679 * @param numberOfBytes
2680 * The amount of bytes to format.
2682 * The formatting pattern to apply.
2683 * @return The formatted bytes using the default pattern.
2686 public static String
formatAsZettabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2687 return formatAsZettabyte(numberOfBytes
.longValue(), format
);
2691 * @param numberOfBytes
2692 * The amount of bytes to format.
2694 * The formatting pattern to apply.
2695 * @return The formatted bytes using the default pattern.
2698 public static String
formatAsZettabyte(final long numberOfBytes
, @NonNull final Format format
) {
2699 return formatAsZettabyte(asBigInteger(numberOfBytes
), format
);
2703 * @param numberOfBytes
2704 * The amount of bytes to format.
2706 * The formatting pattern to apply.
2707 * @return The formatted bytes using the default pattern.
2710 public static String
formatAsZettabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2711 return Zettabyte
.valueOf(numberOfBytes
).toString(format
);
2715 * @param numberOfBytes
2716 * The amount of bytes to format.
2717 * @return The formatted bytes using the default pattern.
2720 public static String
formatAsYottabyte(@NonNull final Long numberOfBytes
) {
2721 return formatAsYottabyte(numberOfBytes
.longValue());
2725 * @param numberOfBytes
2726 * The amount of bytes to format.
2727 * @return The formatted bytes using the default pattern.
2730 public static String
formatAsYottabyte(final long numberOfBytes
) {
2731 return formatAsYottabyte(asBigInteger(numberOfBytes
));
2735 * @param numberOfBytes
2736 * The amount of bytes to format.
2737 * @return The formatted bytes using the default pattern.
2740 public static String
formatAsYottabyte(@NonNull final BigInteger numberOfBytes
) {
2741 return formatAsYottabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2745 * @param numberOfBytes
2746 * The amount of bytes to format.
2748 * The formatting pattern to apply.
2749 * @return The formatted bytes using the default pattern.
2752 public static String
formatAsYottabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2753 return formatAsYottabyte(numberOfBytes
.longValue(), pattern
);
2757 * @param numberOfBytes
2758 * The amount of bytes to format.
2760 * The formatting pattern to apply.
2761 * @return The formatted bytes using the default pattern.
2764 public static String
formatAsYottabyte(final long numberOfBytes
, @NonNull final String pattern
) {
2765 return formatAsYottabyte(asBigInteger(numberOfBytes
), pattern
);
2769 * @param numberOfBytes
2770 * The amount of bytes to format.
2772 * The formatting pattern to apply.
2774 * The locale to use.
2775 * @return The formatted bytes using the default pattern.
2778 public static String
formatAsYottabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2779 @NonNull final Locale locale
) {
2780 return formatAsYottabyte(numberOfBytes
, asFormat(pattern
, locale
));
2784 * @param numberOfBytes
2785 * The amount of bytes to format.
2787 * The formatting pattern to apply.
2789 * The locale to use.
2790 * @return The formatted bytes using the default pattern.
2793 public static String
formatAsYottabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2794 @NonNull final Locale locale
) {
2795 return formatAsYottabyte(numberOfBytes
.longValue(), pattern
, locale
);
2799 * @param numberOfBytes
2800 * The amount of bytes to format.
2802 * The formatting pattern to apply.
2804 * The locale to use.
2805 * @return The formatted bytes using the default pattern.
2808 public static String
formatAsYottabyte(final long numberOfBytes
, @NonNull final String pattern
,
2809 @NonNull final Locale locale
) {
2810 return formatAsYottabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
2814 * @param numberOfBytes
2815 * The amount of bytes to format.
2817 * The formatting pattern to apply.
2818 * @return The formatted bytes using the default pattern.
2821 public static String
formatAsYottabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2822 return formatAsYottabyte(numberOfBytes
, new DecimalFormat(pattern
));
2826 * @param numberOfBytes
2827 * The amount of bytes to format.
2829 * The formatting pattern to apply.
2830 * @return The formatted bytes using the default pattern.
2833 public static String
formatAsYottabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2834 return formatAsYottabyte(numberOfBytes
.longValue(), format
);
2838 * @param numberOfBytes
2839 * The amount of bytes to format.
2841 * The formatting pattern to apply.
2842 * @return The formatted bytes using the default pattern.
2845 public static String
formatAsYottabyte(final long numberOfBytes
, @NonNull final Format format
) {
2846 return formatAsYottabyte(asBigInteger(numberOfBytes
), format
);
2850 * @param numberOfBytes
2851 * The amount of bytes to format.
2853 * The formatting pattern to apply.
2854 * @return The formatted bytes using the default pattern.
2857 public static String
formatAsYottabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
2858 return Yottabyte
.valueOf(numberOfBytes
).toString(format
);
2862 * @param numberOfBytes
2863 * The amount of bytes to format.
2864 * @return The formatted bytes using the default pattern.
2867 public static String
formatAsCommonUnit(@NonNull final Long numberOfBytes
) {
2868 return formatAsCommonUnit(numberOfBytes
.longValue());
2872 * @param numberOfBytes
2873 * The amount of bytes to format.
2874 * @return The formatted bytes using the default pattern.
2877 public static String
formatAsCommonUnit(final long numberOfBytes
) {
2878 return formatAsCommonUnit(asBigInteger(numberOfBytes
));
2882 * @param numberOfBytes
2883 * The amount of bytes to format.
2884 * @return The formatted bytes using the default pattern.
2887 public static String
formatAsCommonUnit(@NonNull final BigInteger numberOfBytes
) {
2888 return formatAsCommonUnit(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
2892 * @param numberOfBytes
2893 * The amount of bytes to format.
2895 * The formatting pattern to apply.
2896 * @return The formatted bytes using the default pattern.
2899 public static String
formatAsCommonUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
2900 return formatAsCommonUnit(numberOfBytes
.longValue(), pattern
);
2904 * @param numberOfBytes
2905 * The amount of bytes to format.
2907 * The formatting pattern to apply.
2908 * @return The formatted bytes using the default pattern.
2911 public static String
formatAsCommonUnit(final long numberOfBytes
, @NonNull final String pattern
) {
2912 return formatAsCommonUnit(asBigInteger(numberOfBytes
), pattern
);
2916 * @param numberOfBytes
2917 * The amount of bytes to format.
2919 * The formatting pattern to apply.
2920 * @return The formatted bytes using the default pattern.
2923 public static String
formatAsCommonUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
2924 return formatAsCommonUnit(numberOfBytes
, new DecimalFormat(pattern
));
2928 * @param numberOfBytes
2929 * The amount of bytes to format.
2931 * The formatting pattern to apply.
2933 * The locale to use.
2934 * @return The formatted bytes using the default pattern.
2937 public static String
formatAsCommonUnit(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
2938 @NonNull final Locale locale
) {
2939 return formatAsCommonUnit(numberOfBytes
.longValue(), pattern
, locale
);
2943 * @param numberOfBytes
2944 * The amount of bytes to format.
2946 * The formatting pattern to apply.
2948 * The locale to use.
2949 * @return The formatted bytes using the default pattern.
2952 public static String
formatAsCommonUnit(final long numberOfBytes
, @NonNull final String pattern
,
2953 @NonNull final Locale locale
) {
2954 return formatAsCommonUnit(asBigInteger(numberOfBytes
), pattern
, locale
);
2958 * @param numberOfBytes
2959 * The amount of bytes to format.
2961 * The formatting pattern to apply.
2963 * The locale to use.
2964 * @return The formatted bytes using the default pattern.
2967 public static String
formatAsCommonUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
2968 @NonNull final Locale locale
) {
2969 return formatAsCommonUnit(numberOfBytes
, asFormat(pattern
, locale
));
2973 * @param numberOfBytes
2974 * The amount of bytes to format.
2976 * The formatting pattern to apply.
2977 * @return The formatted bytes using the default pattern.
2980 public static String
formatAsCommonUnit(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
2981 return formatAsCommonUnit(numberOfBytes
.longValue(), format
);
2985 * @param numberOfBytes
2986 * The amount of bytes to format.
2988 * The formatting pattern to apply.
2989 * @return The formatted bytes using the default pattern.
2992 public static String
formatAsCommonUnit(final long numberOfBytes
, @NonNull final Format format
) {
2993 return formatAsCommonUnit(asBigInteger(numberOfBytes
), format
);
2997 * @param numberOfBytes
2998 * The amount of bytes to format.
3000 * The formatting pattern to apply.
3001 * @return The formatted bytes using the default pattern.
3004 public static String
formatAsCommonUnit(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3005 return commonValueOf(numberOfBytes
).toString(format
);
3009 * @param numberOfBytes
3010 * The amount of bytes to format.
3011 * @return The formatted bytes using the default pattern.
3014 public static String
formatAsCommonKilobyte(@NonNull final Long numberOfBytes
) {
3015 return formatAsCommonKilobyte(numberOfBytes
.longValue());
3019 * @param numberOfBytes
3020 * The amount of bytes to format.
3021 * @return The formatted bytes using the default pattern.
3024 public static String
formatAsCommonKilobyte(final long numberOfBytes
) {
3025 return formatAsCommonKilobyte(asBigInteger(numberOfBytes
));
3029 * @param numberOfBytes
3030 * The amount of bytes to format.
3031 * @return The formatted bytes using the default pattern.
3034 public static String
formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes
) {
3035 return formatAsCommonKilobyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3039 * @param numberOfBytes
3040 * The amount of bytes to format.
3042 * The formatting pattern to apply.
3043 * @return The formatted bytes using the default pattern.
3046 public static String
formatAsCommonKilobyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3047 return formatAsCommonKilobyte(numberOfBytes
.longValue(), pattern
);
3051 * @param numberOfBytes
3052 * The amount of bytes to format.
3054 * The formatting pattern to apply.
3055 * @return The formatted bytes using the default pattern.
3058 public static String
formatAsCommonKilobyte(final long numberOfBytes
, @NonNull final String pattern
) {
3059 return formatAsCommonKilobyte(asBigInteger(numberOfBytes
), pattern
);
3063 * @param numberOfBytes
3064 * The amount of bytes to format.
3066 * The formatting pattern to apply.
3067 * @return The formatted bytes using the default pattern.
3070 public static String
formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes
,
3071 @NonNull final String pattern
) {
3072 return formatAsCommonKilobyte(numberOfBytes
, new DecimalFormat(pattern
));
3076 * @param numberOfBytes
3077 * The amount of bytes to format.
3079 * The formatting pattern to apply.
3081 * The locale to use.
3082 * @return The formatted bytes using the default pattern.
3085 public static String
formatAsCommonKilobyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3086 @NonNull final Locale locale
) {
3087 return formatAsCommonKilobyte(numberOfBytes
.longValue(), pattern
, locale
);
3091 * @param numberOfBytes
3092 * The amount of bytes to format.
3094 * The formatting pattern to apply.
3096 * The locale to use.
3097 * @return The formatted bytes using the default pattern.
3100 public static String
formatAsCommonKilobyte(final long numberOfBytes
, @NonNull final String pattern
,
3101 @NonNull final Locale locale
) {
3102 return formatAsCommonKilobyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3106 * @param numberOfBytes
3107 * The amount of bytes to format.
3109 * The formatting pattern to apply.
3111 * The locale to use.
3112 * @return The formatted bytes using the default pattern.
3115 public static String
formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3116 @NonNull final Locale locale
) {
3117 return formatAsCommonKilobyte(numberOfBytes
, asFormat(pattern
, locale
));
3121 * @param numberOfBytes
3122 * The amount of bytes to format.
3124 * The formatting pattern to apply.
3125 * @return The formatted bytes using the default pattern.
3128 public static String
formatAsCommonKilobyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3129 return formatAsCommonKilobyte(numberOfBytes
.longValue(), format
);
3133 * @param numberOfBytes
3134 * The amount of bytes to format.
3136 * The formatting pattern to apply.
3137 * @return The formatted bytes using the default pattern.
3140 public static String
formatAsCommonKilobyte(final long numberOfBytes
, @NonNull final Format format
) {
3141 return formatAsCommonKilobyte(asBigInteger(numberOfBytes
), format
);
3145 * @param numberOfBytes
3146 * The amount of bytes to format.
3148 * The formatting pattern to apply.
3149 * @return The formatted bytes using the default pattern.
3152 public static String
formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3153 return CommonKilobyte
.valueOf(numberOfBytes
).toString(format
);
3157 * @param numberOfBytes
3158 * The amount of bytes to format.
3159 * @return The formatted bytes using the default pattern.
3162 public static String
formatAsCommonMegabyte(@NonNull final Long numberOfBytes
) {
3163 return formatAsCommonMegabyte(numberOfBytes
.longValue());
3167 * @param numberOfBytes
3168 * The amount of bytes to format.
3169 * @return The formatted bytes using the default pattern.
3172 public static String
formatAsCommonMegabyte(final long numberOfBytes
) {
3173 return formatAsCommonMegabyte(asBigInteger(numberOfBytes
));
3177 * @param numberOfBytes
3178 * The amount of bytes to format.
3179 * @return The formatted bytes using the default pattern.
3182 public static String
formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes
) {
3183 return formatAsCommonMegabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3187 * @param numberOfBytes
3188 * The amount of bytes to format.
3190 * The formatting pattern to apply.
3191 * @return The formatted bytes using the default pattern.
3194 public static String
formatAsCommonMegabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3195 return formatAsCommonMegabyte(numberOfBytes
.longValue(), pattern
);
3199 * @param numberOfBytes
3200 * The amount of bytes to format.
3202 * The formatting pattern to apply.
3203 * @return The formatted bytes using the default pattern.
3206 public static String
formatAsCommonMegabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3207 return formatAsCommonMegabyte(asBigInteger(numberOfBytes
), pattern
);
3211 * @param numberOfBytes
3212 * The amount of bytes to format.
3214 * The formatting pattern to apply.
3215 * @return The formatted bytes using the default pattern.
3218 public static String
formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes
,
3219 @NonNull final String pattern
) {
3220 return formatAsCommonMegabyte(numberOfBytes
, new DecimalFormat(pattern
));
3224 * @param numberOfBytes
3225 * The amount of bytes to format.
3227 * The formatting pattern to apply.
3229 * The locale to use.
3230 * @return The formatted bytes using the default pattern.
3233 public static String
formatAsCommonMegabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3234 @NonNull final Locale locale
) {
3235 return formatAsCommonMegabyte(numberOfBytes
.longValue(), pattern
, locale
);
3239 * @param numberOfBytes
3240 * The amount of bytes to format.
3242 * The formatting pattern to apply.
3244 * The locale to use.
3245 * @return The formatted bytes using the default pattern.
3248 public static String
formatAsCommonMegabyte(final long numberOfBytes
, @NonNull final String pattern
,
3249 @NonNull final Locale locale
) {
3250 return formatAsCommonMegabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3254 * @param numberOfBytes
3255 * The amount of bytes to format.
3257 * The formatting pattern to apply.
3259 * The locale to use.
3260 * @return The formatted bytes using the default pattern.
3263 public static String
formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3264 @NonNull final Locale locale
) {
3265 return formatAsCommonMegabyte(numberOfBytes
, asFormat(pattern
, locale
));
3269 * @param numberOfBytes
3270 * The amount of bytes to format.
3272 * The formatting pattern to apply.
3273 * @return The formatted bytes using the default pattern.
3276 public static String
formatAsCommonMegabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3277 return formatAsCommonMegabyte(numberOfBytes
.longValue(), format
);
3281 * @param numberOfBytes
3282 * The amount of bytes to format.
3284 * The formatting pattern to apply.
3285 * @return The formatted bytes using the default pattern.
3288 public static String
formatAsCommonMegabyte(final long numberOfBytes
, @NonNull final Format format
) {
3289 return formatAsCommonMegabyte(asBigInteger(numberOfBytes
), format
);
3293 * @param numberOfBytes
3294 * The amount of bytes to format.
3296 * The formatting pattern to apply.
3297 * @return The formatted bytes using the default pattern.
3300 public static String
formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3301 return CommonMegabyte
.valueOf(numberOfBytes
).toString(format
);
3305 * @param numberOfBytes
3306 * The amount of bytes to format.
3307 * @return The formatted bytes using the default pattern.
3310 public static String
formatAsCommonGigabyte(@NonNull final Long numberOfBytes
) {
3311 return formatAsCommonGigabyte(numberOfBytes
.longValue());
3315 * @param numberOfBytes
3316 * The amount of bytes to format.
3317 * @return The formatted bytes using the default pattern.
3320 public static String
formatAsCommonGigabyte(final long numberOfBytes
) {
3321 return formatAsCommonGigabyte(asBigInteger(numberOfBytes
));
3325 * @param numberOfBytes
3326 * The amount of bytes to format.
3327 * @return The formatted bytes using the default pattern.
3330 public static String
formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes
) {
3331 return formatAsCommonGigabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3335 * @param numberOfBytes
3336 * The amount of bytes to format.
3338 * The formatting pattern to apply.
3339 * @return The formatted bytes using the default pattern.
3342 public static String
formatAsCommonGigabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3343 return formatAsCommonGigabyte(numberOfBytes
.longValue(), pattern
);
3347 * @param numberOfBytes
3348 * The amount of bytes to format.
3350 * The formatting pattern to apply.
3351 * @return The formatted bytes using the default pattern.
3354 public static String
formatAsCommonGigabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3355 return formatAsCommonGigabyte(asBigInteger(numberOfBytes
), pattern
);
3359 * @param numberOfBytes
3360 * The amount of bytes to format.
3362 * The formatting pattern to apply.
3363 * @return The formatted bytes using the default pattern.
3366 public static String
formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes
,
3367 @NonNull final String pattern
) {
3368 return formatAsCommonGigabyte(numberOfBytes
, new DecimalFormat(pattern
));
3372 * @param numberOfBytes
3373 * The amount of bytes to format.
3375 * The formatting pattern to apply.
3377 * The locale to use.
3378 * @return The formatted bytes using the default pattern.
3381 public static String
formatAsCommonGigabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3382 @NonNull final Locale locale
) {
3383 return formatAsCommonGigabyte(numberOfBytes
.longValue(), pattern
, locale
);
3387 * @param numberOfBytes
3388 * The amount of bytes to format.
3390 * The formatting pattern to apply.
3392 * The locale to use.
3393 * @return The formatted bytes using the default pattern.
3396 public static String
formatAsCommonGigabyte(final long numberOfBytes
, @NonNull final String pattern
,
3397 @NonNull final Locale locale
) {
3398 return formatAsCommonGigabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3402 * @param numberOfBytes
3403 * The amount of bytes to format.
3405 * The formatting pattern to apply.
3407 * The locale to use.
3408 * @return The formatted bytes using the default pattern.
3411 public static String
formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3412 @NonNull final Locale locale
) {
3413 return formatAsCommonGigabyte(numberOfBytes
, asFormat(pattern
, locale
));
3417 * @param numberOfBytes
3418 * The amount of bytes to format.
3420 * The formatting pattern to apply.
3421 * @return The formatted bytes using the default pattern.
3424 public static String
formatAsCommonGigabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3425 return formatAsCommonGigabyte(numberOfBytes
.longValue(), format
);
3429 * @param numberOfBytes
3430 * The amount of bytes to format.
3432 * The formatting pattern to apply.
3433 * @return The formatted bytes using the default pattern.
3436 public static String
formatAsCommonGigabyte(final long numberOfBytes
, @NonNull final Format format
) {
3437 return formatAsCommonGigabyte(asBigInteger(numberOfBytes
), format
);
3441 * @param numberOfBytes
3442 * The amount of bytes to format.
3444 * The formatting pattern to apply.
3445 * @return The formatted bytes using the default pattern.
3448 public static String
formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3449 return CommonGigabyte
.valueOf(numberOfBytes
).toString(format
);
3453 * @param numberOfBytes
3454 * The amount of bytes to format.
3455 * @return The formatted bytes using the default pattern.
3458 public static String
formatAsCommonTerabyte(@NonNull final Long numberOfBytes
) {
3459 return formatAsCommonTerabyte(numberOfBytes
.longValue());
3463 * @param numberOfBytes
3464 * The amount of bytes to format.
3465 * @return The formatted bytes using the default pattern.
3468 public static String
formatAsCommonTerabyte(final long numberOfBytes
) {
3469 return formatAsCommonTerabyte(asBigInteger(numberOfBytes
));
3473 * @param numberOfBytes
3474 * The amount of bytes to format.
3475 * @return The formatted bytes using the default pattern.
3478 public static String
formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes
) {
3479 return formatAsCommonTerabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3483 * @param numberOfBytes
3484 * The amount of bytes to format.
3486 * The formatting pattern to apply.
3487 * @return The formatted bytes using the default pattern.
3490 public static String
formatAsCommonTerabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3491 return formatAsCommonTerabyte(numberOfBytes
.longValue(), pattern
);
3495 * @param numberOfBytes
3496 * The amount of bytes to format.
3498 * The formatting pattern to apply.
3499 * @return The formatted bytes using the default pattern.
3502 public static String
formatAsCommonTerabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3503 return formatAsCommonTerabyte(asBigInteger(numberOfBytes
), pattern
);
3507 * @param numberOfBytes
3508 * The amount of bytes to format.
3510 * The formatting pattern to apply.
3511 * @return The formatted bytes using the default pattern.
3514 public static String
formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes
,
3515 @NonNull final String pattern
) {
3516 return formatAsCommonTerabyte(numberOfBytes
, new DecimalFormat(pattern
));
3520 * @param numberOfBytes
3521 * The amount of bytes to format.
3523 * The formatting pattern to apply.
3525 * The locale to use.
3526 * @return The formatted bytes using the default pattern.
3529 public static String
formatAsCommonTerabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3530 @NonNull final Locale locale
) {
3531 return formatAsCommonTerabyte(numberOfBytes
.longValue(), pattern
, locale
);
3535 * @param numberOfBytes
3536 * The amount of bytes to format.
3538 * The formatting pattern to apply.
3540 * The locale to use.
3541 * @return The formatted bytes using the default pattern.
3544 public static String
formatAsCommonTerabyte(final long numberOfBytes
, @NonNull final String pattern
,
3545 @NonNull final Locale locale
) {
3546 return formatAsCommonTerabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3550 * @param numberOfBytes
3551 * The amount of bytes to format.
3553 * The formatting pattern to apply.
3555 * The locale to use.
3556 * @return The formatted bytes using the default pattern.
3559 public static String
formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3560 @NonNull final Locale locale
) {
3561 return formatAsCommonTerabyte(numberOfBytes
, asFormat(pattern
, locale
));
3565 * @param numberOfBytes
3566 * The amount of bytes to format.
3568 * The formatting pattern to apply.
3569 * @return The formatted bytes using the default pattern.
3572 public static String
formatAsCommonTerabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3573 return formatAsCommonTerabyte(numberOfBytes
.longValue(), format
);
3577 * @param numberOfBytes
3578 * The amount of bytes to format.
3580 * The formatting pattern to apply.
3581 * @return The formatted bytes using the default pattern.
3584 public static String
formatAsCommonTerabyte(final long numberOfBytes
, @NonNull final Format format
) {
3585 return formatAsCommonTerabyte(asBigInteger(numberOfBytes
), format
);
3589 * @param numberOfBytes
3590 * The amount of bytes to format.
3592 * The formatting pattern to apply.
3593 * @return The formatted bytes using the default pattern.
3596 public static String
formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3597 return CommonTerabyte
.valueOf(numberOfBytes
).toString(format
);
3601 * @param numberOfBytes
3602 * The amount of bytes to format.
3603 * @return The formatted bytes using the default pattern.
3606 public static String
formatAsCommonPetabyte(@NonNull final Long numberOfBytes
) {
3607 return formatAsCommonPetabyte(numberOfBytes
.longValue());
3611 * @param numberOfBytes
3612 * The amount of bytes to format.
3613 * @return The formatted bytes using the default pattern.
3616 public static String
formatAsCommonPetabyte(final long numberOfBytes
) {
3617 return formatAsCommonPetabyte(asBigInteger(numberOfBytes
));
3621 * @param numberOfBytes
3622 * The amount of bytes to format.
3623 * @return The formatted bytes using the default pattern.
3626 public static String
formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes
) {
3627 return formatAsCommonPetabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3631 * @param numberOfBytes
3632 * The amount of bytes to format.
3634 * The formatting pattern to apply.
3635 * @return The formatted bytes using the default pattern.
3638 public static String
formatAsCommonPetabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3639 return formatAsCommonPetabyte(numberOfBytes
.longValue(), pattern
);
3643 * @param numberOfBytes
3644 * The amount of bytes to format.
3646 * The formatting pattern to apply.
3647 * @return The formatted bytes using the default pattern.
3650 public static String
formatAsCommonPetabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3651 return formatAsCommonPetabyte(asBigInteger(numberOfBytes
), pattern
);
3655 * @param numberOfBytes
3656 * The amount of bytes to format.
3658 * The formatting pattern to apply.
3659 * @return The formatted bytes using the default pattern.
3662 public static String
formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes
,
3663 @NonNull final String pattern
) {
3664 return formatAsCommonPetabyte(numberOfBytes
, new DecimalFormat(pattern
));
3668 * @param numberOfBytes
3669 * The amount of bytes to format.
3671 * The formatting pattern to apply.
3673 * The locale to use.
3674 * @return The formatted bytes using the default pattern.
3677 public static String
formatAsCommonPetabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3678 @NonNull final Locale locale
) {
3679 return formatAsCommonPetabyte(numberOfBytes
.longValue(), pattern
, locale
);
3683 * @param numberOfBytes
3684 * The amount of bytes to format.
3686 * The formatting pattern to apply.
3688 * The locale to use.
3689 * @return The formatted bytes using the default pattern.
3692 public static String
formatAsCommonPetabyte(final long numberOfBytes
, @NonNull final String pattern
,
3693 @NonNull final Locale locale
) {
3694 return formatAsCommonPetabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3698 * @param numberOfBytes
3699 * The amount of bytes to format.
3701 * The formatting pattern to apply.
3703 * The locale to use.
3704 * @return The formatted bytes using the default pattern.
3707 public static String
formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3708 @NonNull final Locale locale
) {
3709 return formatAsCommonPetabyte(numberOfBytes
, asFormat(pattern
, locale
));
3713 * @param numberOfBytes
3714 * The amount of bytes to format.
3716 * The formatting pattern to apply.
3717 * @return The formatted bytes using the default pattern.
3720 public static String
formatAsCommonPetabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3721 return formatAsCommonPetabyte(numberOfBytes
.longValue(), format
);
3725 * @param numberOfBytes
3726 * The amount of bytes to format.
3728 * The formatting pattern to apply.
3729 * @return The formatted bytes using the default pattern.
3732 public static String
formatAsCommonPetabyte(final long numberOfBytes
, @NonNull final Format format
) {
3733 return formatAsCommonPetabyte(asBigInteger(numberOfBytes
), format
);
3737 * @param numberOfBytes
3738 * The amount of bytes to format.
3740 * The formatting pattern to apply.
3741 * @return The formatted bytes using the default pattern.
3744 public static String
formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3745 return CommonPetabyte
.valueOf(numberOfBytes
).toString(format
);
3749 * @param numberOfBytes
3750 * The amount of bytes to format.
3751 * @return The formatted bytes using the default pattern.
3754 public static String
formatAsCommonExabyte(@NonNull final Long numberOfBytes
) {
3755 return formatAsCommonExabyte(numberOfBytes
.longValue());
3759 * @param numberOfBytes
3760 * The amount of bytes to format.
3761 * @return The formatted bytes using the default pattern.
3764 public static String
formatAsCommonExabyte(final long numberOfBytes
) {
3765 return formatAsCommonExabyte(asBigInteger(numberOfBytes
));
3769 * @param numberOfBytes
3770 * The amount of bytes to format.
3771 * @return The formatted bytes using the default pattern.
3774 public static String
formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes
) {
3775 return formatAsCommonExabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3779 * @param numberOfBytes
3780 * The amount of bytes to format.
3782 * The formatting pattern to apply.
3783 * @return The formatted bytes using the default pattern.
3786 public static String
formatAsCommonExabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3787 return formatAsCommonExabyte(numberOfBytes
.longValue(), pattern
);
3791 * @param numberOfBytes
3792 * The amount of bytes to format.
3794 * The formatting pattern to apply.
3795 * @return The formatted bytes using the default pattern.
3798 public static String
formatAsCommonExabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3799 return formatAsCommonExabyte(asBigInteger(numberOfBytes
), pattern
);
3803 * @param numberOfBytes
3804 * The amount of bytes to format.
3806 * The formatting pattern to apply.
3807 * @return The formatted bytes using the default pattern.
3810 public static String
formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
) {
3811 return formatAsCommonExabyte(numberOfBytes
, new DecimalFormat(pattern
));
3815 * @param numberOfBytes
3816 * The amount of bytes to format.
3818 * The formatting pattern to apply.
3820 * The locale to use.
3821 * @return The formatted bytes using the default pattern.
3824 public static String
formatAsCommonExabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3825 @NonNull final Locale locale
) {
3826 return formatAsCommonExabyte(numberOfBytes
.longValue(), pattern
, locale
);
3830 * @param numberOfBytes
3831 * The amount of bytes to format.
3833 * The formatting pattern to apply.
3835 * The locale to use.
3836 * @return The formatted bytes using the default pattern.
3839 public static String
formatAsCommonExabyte(final long numberOfBytes
, @NonNull final String pattern
,
3840 @NonNull final Locale locale
) {
3841 return formatAsCommonExabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3845 * @param numberOfBytes
3846 * The amount of bytes to format.
3848 * The formatting pattern to apply.
3850 * The locale to use.
3851 * @return The formatted bytes using the default pattern.
3854 public static String
formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
3855 @NonNull final Locale locale
) {
3856 return formatAsCommonExabyte(numberOfBytes
, asFormat(pattern
, locale
));
3860 * @param numberOfBytes
3861 * The amount of bytes to format.
3863 * The formatting pattern to apply.
3864 * @return The formatted bytes using the default pattern.
3867 public static String
formatAsCommonExabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
3868 return formatAsCommonExabyte(numberOfBytes
.longValue(), format
);
3872 * @param numberOfBytes
3873 * The amount of bytes to format.
3875 * The formatting pattern to apply.
3876 * @return The formatted bytes using the default pattern.
3879 public static String
formatAsCommonExabyte(final long numberOfBytes
, @NonNull final Format format
) {
3880 return formatAsCommonExabyte(asBigInteger(numberOfBytes
), format
);
3884 * @param numberOfBytes
3885 * The amount of bytes to format.
3887 * The formatting pattern to apply.
3888 * @return The formatted bytes using the default pattern.
3891 public static String
formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final Format format
) {
3892 return CommonExabyte
.valueOf(numberOfBytes
).toString(format
);
3896 * @param numberOfBytes
3897 * The amount of bytes to format.
3898 * @return The formatted bytes using the default pattern.
3901 public static String
formatAsCommonZettabyte(@NonNull final Long numberOfBytes
) {
3902 return formatAsCommonZettabyte(numberOfBytes
.longValue());
3906 * @param numberOfBytes
3907 * The amount of bytes to format.
3908 * @return The formatted bytes using the default pattern.
3911 public static String
formatAsCommonZettabyte(final long numberOfBytes
) {
3912 return formatAsCommonZettabyte(asBigInteger(numberOfBytes
));
3916 * @param numberOfBytes
3917 * The amount of bytes to format.
3918 * @return The formatted bytes using the default pattern.
3921 public static String
formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes
) {
3922 return formatAsCommonZettabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
3926 * @param numberOfBytes
3927 * The amount of bytes to format.
3929 * The formatting pattern to apply.
3930 * @return The formatted bytes using the default pattern.
3933 public static String
formatAsCommonZettabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
3934 return formatAsCommonZettabyte(numberOfBytes
.longValue(), pattern
);
3938 * @param numberOfBytes
3939 * The amount of bytes to format.
3941 * The formatting pattern to apply.
3942 * @return The formatted bytes using the default pattern.
3945 public static String
formatAsCommonZettabyte(final long numberOfBytes
, @NonNull final String pattern
) {
3946 return formatAsCommonZettabyte(asBigInteger(numberOfBytes
), pattern
);
3950 * @param numberOfBytes
3951 * The amount of bytes to format.
3953 * The formatting pattern to apply.
3954 * @return The formatted bytes using the default pattern.
3957 public static String
formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes
,
3958 @NonNull final String pattern
) {
3959 return formatAsCommonZettabyte(numberOfBytes
, new DecimalFormat(pattern
));
3963 * @param numberOfBytes
3964 * The amount of bytes to format.
3966 * The formatting pattern to apply.
3968 * The locale to use.
3969 * @return The formatted bytes using the default pattern.
3972 public static String
formatAsCommonZettabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
3973 @NonNull final Locale locale
) {
3974 return formatAsCommonZettabyte(numberOfBytes
.longValue(), pattern
, locale
);
3978 * @param numberOfBytes
3979 * The amount of bytes to format.
3981 * The formatting pattern to apply.
3983 * The locale to use.
3984 * @return The formatted bytes using the default pattern.
3987 public static String
formatAsCommonZettabyte(final long numberOfBytes
, @NonNull final String pattern
,
3988 @NonNull final Locale locale
) {
3989 return formatAsCommonZettabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
3993 * @param numberOfBytes
3994 * The amount of bytes to format.
3996 * The formatting pattern to apply.
3998 * The locale to use.
3999 * @return The formatted bytes using the default pattern.
4002 public static String
formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
4003 @NonNull final Locale locale
) {
4004 return formatAsCommonZettabyte(numberOfBytes
, asFormat(pattern
, locale
));
4008 * @param numberOfBytes
4009 * The amount of bytes to format.
4011 * The formatting pattern to apply.
4012 * @return The formatted bytes using the default pattern.
4015 public static String
formatAsCommonZettabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
4016 return formatAsCommonZettabyte(numberOfBytes
.longValue(), format
);
4020 * @param numberOfBytes
4021 * The amount of bytes to format.
4023 * The formatting pattern to apply.
4024 * @return The formatted bytes using the default pattern.
4027 public static String
formatAsCommonZettabyte(final long numberOfBytes
, @NonNull final Format format
) {
4028 return formatAsCommonZettabyte(asBigInteger(numberOfBytes
), format
);
4032 * @param numberOfBytes
4033 * The amount of bytes to format.
4035 * The formatting pattern to apply.
4036 * @return The formatted bytes using the default pattern.
4039 public static String
formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes
,
4040 @NonNull final Format format
) {
4041 return CommonZettabyte
.valueOf(numberOfBytes
).toString(format
);
4045 * @param numberOfBytes
4046 * The amount of bytes to format.
4047 * @return The formatted bytes using the default pattern.
4050 public static String
formatAsCommonYottabyte(@NonNull final Long numberOfBytes
) {
4051 return formatAsCommonYottabyte(numberOfBytes
.longValue());
4055 * @param numberOfBytes
4056 * The amount of bytes to format.
4057 * @return The formatted bytes using the default pattern.
4060 public static String
formatAsCommonYottabyte(final long numberOfBytes
) {
4061 return formatAsCommonYottabyte(asBigInteger(numberOfBytes
));
4065 * @param numberOfBytes
4066 * The amount of bytes to format.
4067 * @return The formatted bytes using the default pattern.
4070 public static String
formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes
) {
4071 return formatAsCommonYottabyte(numberOfBytes
, DEFAULT_FORMAT_PATTERN
);
4075 * @param numberOfBytes
4076 * The amount of bytes to format.
4078 * The formatting pattern to apply.
4079 * @return The formatted bytes using the default pattern.
4082 public static String
formatAsCommonYottabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
) {
4083 return formatAsCommonYottabyte(numberOfBytes
.longValue(), pattern
);
4087 * @param numberOfBytes
4088 * The amount of bytes to format.
4090 * The formatting pattern to apply.
4091 * @return The formatted bytes using the default pattern.
4094 public static String
formatAsCommonYottabyte(final long numberOfBytes
, @NonNull final String pattern
) {
4095 return formatAsCommonYottabyte(asBigInteger(numberOfBytes
), pattern
);
4099 * @param numberOfBytes
4100 * The amount of bytes to format.
4102 * The formatting pattern to apply.
4104 * The locale to use.
4105 * @return The formatted bytes using the default pattern.
4108 public static String
formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes
, @NonNull final String pattern
,
4109 @NonNull final Locale locale
) {
4110 return formatAsCommonYottabyte(numberOfBytes
, asFormat(pattern
, locale
));
4114 * @param numberOfBytes
4115 * The amount of bytes to format.
4117 * The formatting pattern to apply.
4119 * The locale to use.
4120 * @return The formatted bytes using the default pattern.
4123 public static String
formatAsCommonYottabyte(@NonNull final Long numberOfBytes
, @NonNull final String pattern
,
4124 @NonNull final Locale locale
) {
4125 return formatAsCommonYottabyte(numberOfBytes
.longValue(), pattern
, locale
);
4129 * @param numberOfBytes
4130 * The amount of bytes to format.
4132 * The formatting pattern to apply.
4134 * The locale to use.
4135 * @return The formatted bytes using the default pattern.
4138 public static String
formatAsCommonYottabyte(final long numberOfBytes
, @NonNull final String pattern
,
4139 @NonNull final Locale locale
) {
4140 return formatAsCommonYottabyte(asBigInteger(numberOfBytes
), pattern
, locale
);
4144 * @param numberOfBytes
4145 * The amount of bytes to format.
4147 * The formatting pattern to apply.
4148 * @return The formatted bytes using the default pattern.
4151 public static String
formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes
,
4152 @NonNull final String pattern
) {
4153 return formatAsCommonYottabyte(numberOfBytes
, new DecimalFormat(pattern
));
4157 * @param numberOfBytes
4158 * The amount of bytes to format.
4160 * The formatting pattern to apply.
4161 * @return The formatted bytes using the default pattern.
4164 public static String
formatAsCommonYottabyte(@NonNull final Long numberOfBytes
, @NonNull final Format format
) {
4165 return formatAsCommonYottabyte(numberOfBytes
.longValue(), format
);
4169 * @param numberOfBytes
4170 * The amount of bytes to format.
4172 * The formatting pattern to apply.
4173 * @return The formatted bytes using the default pattern.
4176 public static String
formatAsCommonYottabyte(final long numberOfBytes
, @NonNull final Format format
) {
4177 return formatAsCommonYottabyte(asBigInteger(numberOfBytes
), format
);
4181 * @param numberOfBytes
4182 * The amount of bytes to format.
4184 * The formatting pattern to apply.
4185 * @return The formatted bytes using the default pattern.
4188 public static String
formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes
,
4189 @NonNull final Format format
) {
4190 return CommonYottabyte
.valueOf(numberOfBytes
).toString(format
);
4194 * @param numberOfBytes
4195 * The amount of bytes to create.
4196 * @return A new unit representing the given amount of bytes.
4199 public static Byte
bytes(@NonNull final Long numberOfBytes
) {
4200 return bytes(numberOfBytes
.longValue());
4204 * @param numberOfBytes
4205 * The amount of bytes to create.
4206 * @return A new unit representing the given amount of bytes.
4209 public static Byte
bytes(final long numberOfBytes
) {
4210 return bytes(asBigInteger(numberOfBytes
));
4214 * @param numberOfBytes
4215 * The amount of bytes to create.
4216 * @return A new unit representing the given amount of bytes.
4219 public static Byte
bytes(@NonNull final BigInteger numberOfBytes
) {
4220 return new Byte(numberOfBytes
);
4224 * @param numberOfKibibytes
4225 * The amount of kibibytes to create.
4226 * @return A new unit representing the given amount of kibibytes.
4229 public static Kibibyte
kibibyte(@NonNull final Long numberOfKibibytes
) {
4230 return kibibyte(numberOfKibibytes
.longValue());
4234 * @param numberOfKibibytes
4235 * The amount of kibibytes to create.
4236 * @return A new unit representing the given amount of kibibytes.
4239 public static Kibibyte
kibibyte(final long numberOfKibibytes
) {
4240 return kibibyte(asBigInteger(numberOfKibibytes
));
4244 * @param numberOfKibibytes
4245 * The amount of kibibytes to create.
4246 * @return A new unit representing the given amount of kibibytes.
4249 public static Kibibyte
kibibyte(@NonNull final BigInteger numberOfKibibytes
) {
4250 return new Kibibyte(multiplyNullsafe(BYTES_IN_A_KIBIBYTE
, numberOfKibibytes
));
4254 * @param numberOfMebibytes
4255 * The amount of mebibytes to create.
4256 * @return A new unit representing the given amount of mebibytes.
4259 public static Mebibyte
mebibyte(@NonNull final Long numberOfMebibytes
) {
4260 return mebibyte(numberOfMebibytes
.longValue());
4264 * @param numberOfMebibytes
4265 * The amount of mebibytes to create.
4266 * @return A new unit representing the given amount of mebibytes.
4269 public static Mebibyte
mebibyte(final long numberOfMebibytes
) {
4270 return mebibyte(asBigInteger(numberOfMebibytes
));
4274 * @param numberOfMebibytes
4275 * The amount of mebibytes to create.
4276 * @return A new unit representing the given amount of mebibytes.
4279 public static Mebibyte
mebibyte(@NonNull final BigInteger numberOfMebibytes
) {
4280 return new Mebibyte(multiplyNullsafe(BYTES_IN_A_MEBIBYTE
, numberOfMebibytes
));
4284 * @param numberOfGibibytes
4285 * The amount of gibibytes to create.
4286 * @return A new unit representing the given amount of gibibytes.
4289 public static Gibibyte
gibibyte(@NonNull final Long numberOfGibibytes
) {
4290 return gibibyte(numberOfGibibytes
.longValue());
4294 * @param numberOfGibibytes
4295 * The amount of gibibytes to create.
4296 * @return A new unit representing the given amount of gibibytes.
4299 public static Gibibyte
gibibyte(final long numberOfGibibytes
) {
4300 return gibibyte(asBigInteger(numberOfGibibytes
));
4304 * @param numberOfGibibytes
4305 * The amount of gibibytes to create.
4306 * @return A new unit representing the given amount of gibibytes.
4309 public static Gibibyte
gibibyte(@NonNull final BigInteger numberOfGibibytes
) {
4310 return new Gibibyte(multiplyNullsafe(BYTES_IN_A_GIBIBYTE
, numberOfGibibytes
));
4314 * @param numberOfTebibytes
4315 * The amount of tebibytes to create.
4316 * @return A new unit representing the given amount of tebibytes.
4319 public static Tebibyte
tebibyte(@NonNull final Long numberOfTebibytes
) {
4320 return tebibyte(numberOfTebibytes
.longValue());
4324 * @param numberOfTebibytes
4325 * The amount of tebibytes to create.
4326 * @return A new unit representing the given amount of tebibytes.
4329 public static Tebibyte
tebibyte(final long numberOfTebibytes
) {
4330 return tebibyte(asBigInteger(numberOfTebibytes
));
4334 * @param numberOfTebibytes
4335 * The amount of tebibytes to create.
4336 * @return A new unit representing the given amount of tebibytes.
4339 public static Tebibyte
tebibyte(@NonNull final BigInteger numberOfTebibytes
) {
4340 return new Tebibyte(multiplyNullsafe(BYTES_IN_A_TEBIBYTE
, numberOfTebibytes
));
4344 * @param numberOfPebibytes
4345 * The amount of pebibytes to create.
4346 * @return A new unit representing the given amount of pebibytes.
4349 public static Pebibyte
pebibyte(@NonNull final Long numberOfPebibytes
) {
4350 return pebibyte(numberOfPebibytes
.longValue());
4354 * @param numberOfPebibytes
4355 * The amount of pebibytes to create.
4356 * @return A new unit representing the given amount of pebibytes.
4359 public static Pebibyte
pebibyte(final long numberOfPebibytes
) {
4360 return pebibyte(asBigInteger(numberOfPebibytes
));
4364 * @param numberOfPebibytes
4365 * The amount of pebibytes to create.
4366 * @return A new unit representing the given amount of pebibytes.
4369 public static Pebibyte
pebibyte(@NonNull final BigInteger numberOfPebibytes
) {
4370 return new Pebibyte(multiplyNullsafe(BYTES_IN_A_PEBIBYTE
, numberOfPebibytes
));
4374 * @param numberOfExbibytes
4375 * The amount of exbibytes to create.
4376 * @return A new unit representing the given amount of exbibytes.
4379 public static Exbibyte
exbibyte(@NonNull final Long numberOfExbibytes
) {
4380 return exbibyte(numberOfExbibytes
.longValue());
4384 * @param numberOfExbibytes
4385 * The amount of exbibytes to create.
4386 * @return A new unit representing the given amount of exbibytes.
4389 public static Exbibyte
exbibyte(final long numberOfExbibytes
) {
4390 return exbibyte(asBigInteger(numberOfExbibytes
));
4394 * @param numberOfExbibytes
4395 * The amount of exbibytes to create.
4396 * @return A new unit representing the given amount of exbibytes.
4399 public static Exbibyte
exbibyte(@NonNull final BigInteger numberOfExbibytes
) {
4400 return new Exbibyte(multiplyNullsafe(BYTES_IN_A_EXBIBYTE
, numberOfExbibytes
));
4404 * @param numberOfZebibytes
4405 * The amount of zebibytes to create.
4406 * @return A new unit representing the given amount of zebibytes.
4409 public static Zebibyte
zebibyte(@NonNull final Long numberOfZebibytes
) {
4410 return zebibyte(numberOfZebibytes
.longValue());
4414 * @param numberOfZebibytes
4415 * The amount of zebibytes to create.
4416 * @return A new unit representing the given amount of zebibytes.
4419 public static Zebibyte
zebibyte(final long numberOfZebibytes
) {
4420 return zebibyte(asBigInteger(numberOfZebibytes
));
4424 * @param numberOfZebibytes
4425 * The amount of zebibytes to create.
4426 * @return A new unit representing the given amount of zebibytes.
4429 public static Zebibyte
zebibyte(@NonNull final BigInteger numberOfZebibytes
) {
4430 return new Zebibyte(multiplyNullsafe(BYTES_IN_A_ZEBIBYTE
, numberOfZebibytes
));
4434 * @param numberOfYobibytes
4435 * The amount of yobibytes to create.
4436 * @return A new unit representing the given amount of yobibytes.
4439 public static Yobibyte
yobibyte(@NonNull final Long numberOfYobibytes
) {
4440 return yobibyte(numberOfYobibytes
.longValue());
4444 * @param numberOfYobibytes
4445 * The amount of yobibytes to create.
4446 * @return A new unit representing the given amount of yobibytes.
4449 public static Yobibyte
yobibyte(final long numberOfYobibytes
) {
4450 return yobibyte(asBigInteger(numberOfYobibytes
));
4454 * @param numberOfYobibytes
4455 * The amount of yobibytes to create.
4456 * @return A new unit representing the given amount of yobibytes.
4459 public static Yobibyte
yobibyte(@NonNull final BigInteger numberOfYobibytes
) {
4460 return new Yobibyte(multiplyNullsafe(BYTES_IN_A_YOBIBYTE
, numberOfYobibytes
));
4464 * @param numberOfKilobytes
4465 * The number of kilobytes to create.
4466 * @return A new unit representing the given amount of kilobytes.
4469 public static Kilobyte
kilobyte(@NonNull final Long numberOfKilobytes
) {
4470 return kilobyte(numberOfKilobytes
.longValue());
4474 * @param numberOfKilobytes
4475 * The number of kilobytes to create.
4476 * @return A new unit representing the given amount of kilobytes.
4479 public static Kilobyte
kilobyte(final long numberOfKilobytes
) {
4480 return kilobyte(asBigInteger(numberOfKilobytes
));
4484 * @param numberOfKilobytes
4485 * The number of kilobytes to create.
4486 * @return A new unit representing the given amount of kilobytes.
4489 public static Kilobyte
kilobyte(@NonNull final BigInteger numberOfKilobytes
) {
4490 return new Kilobyte(multiplyNullsafe(BYTES_IN_A_KILOBYTE
, numberOfKilobytes
));
4494 * @param numberOfMegabytes
4495 * The number of megabytes to create.
4496 * @return A new unit representing the given amount of megabytes.
4499 public static Megabyte
megabyte(@NonNull final Long numberOfMegabytes
) {
4500 return megabyte(numberOfMegabytes
.longValue());
4504 * @param numberOfMegabytes
4505 * The number of megabytes to create.
4506 * @return A new unit representing the given amount of megabytes.
4509 public static Megabyte
megabyte(final long numberOfMegabytes
) {
4510 return megabyte(asBigInteger(numberOfMegabytes
));
4514 * @param numberOfMegabytes
4515 * The number of megabytes to create.
4516 * @return A new unit representing the given amount of megabytes.
4519 public static Megabyte
megabyte(@NonNull final BigInteger numberOfMegabytes
) {
4520 return new Megabyte(multiplyNullsafe(BYTES_IN_A_MEGABYTE
, numberOfMegabytes
));
4524 * @param numberOfGigabytes
4525 * The number of gigabytes to create.
4526 * @return A new unit representing the given amount of gigabytes.
4529 public static Gigabyte
gigabyte(@NonNull final Long numberOfGigabytes
) {
4530 return gigabyte(numberOfGigabytes
.longValue());
4534 * @param numberOfGigabytes
4535 * The number of gigabytes to create.
4536 * @return A new unit representing the given amount of gigabytes.
4539 public static Gigabyte
gigabyte(final long numberOfGigabytes
) {
4540 return gigabyte(asBigInteger(numberOfGigabytes
));
4544 * @param numberOfGigabytes
4545 * The number of gigabytes to create.
4546 * @return A new unit representing the given amount of gigabytes.
4549 public static Gigabyte
gigabyte(@NonNull final BigInteger numberOfGigabytes
) {
4550 return new Gigabyte(multiplyNullsafe(BYTES_IN_A_GIGABYTE
, numberOfGigabytes
));
4554 * @param numberOfTerabytes
4555 * The number of terabytes to create.
4556 * @return A new unit representing the given amount of terabytes.
4559 public static Terabyte
terabyte(@NonNull final Long numberOfTerabytes
) {
4560 return terabyte(numberOfTerabytes
.longValue());
4564 * @param numberOfTerabytes
4565 * The number of terabytes to create.
4566 * @return A new unit representing the given amount of terabytes.
4569 public static Terabyte
terabyte(final long numberOfTerabytes
) {
4570 return terabyte(asBigInteger(numberOfTerabytes
));
4574 * @param numberOfTerabytes
4575 * The number of terabytes to create.
4576 * @return A new unit representing the given amount of terabytes.
4579 public static Terabyte
terabyte(@NonNull final BigInteger numberOfTerabytes
) {
4580 return new Terabyte(multiplyNullsafe(BYTES_IN_A_TERABYTE
, numberOfTerabytes
));
4584 * @param numberOfPetabytes
4585 * The number of petabytes to create.
4586 * @return A new unit representing the given amount of petabytes.
4589 public static Petabyte
petabyte(@NonNull final Long numberOfPetabytes
) {
4590 return petabyte(numberOfPetabytes
.longValue());
4594 * @param numberOfPetabytes
4595 * The number of petabytes to create.
4596 * @return A new unit representing the given amount of petabytes.
4599 public static Petabyte
petabyte(final long numberOfPetabytes
) {
4600 return petabyte(asBigInteger(numberOfPetabytes
));
4604 * @param numberOfPetabytes
4605 * The number of petabytes to create.
4606 * @return A new unit representing the given amount of petabytes.
4609 public static Petabyte
petabyte(@NonNull final BigInteger numberOfPetabytes
) {
4610 return new Petabyte(multiplyNullsafe(BYTES_IN_A_PETABYTE
, numberOfPetabytes
));
4614 * @param numberOfExabytes
4615 * The number of exabytes to create.
4616 * @return A new unit representing the given amount of exabytes.
4619 public static Exabyte
exabyte(@NonNull final Long numberOfExabytes
) {
4620 return exabyte(numberOfExabytes
.longValue());
4624 * @param numberOfExabytes
4625 * The number of exabytes to create.
4626 * @return A new unit representing the given amount of exabytes.
4629 public static Exabyte
exabyte(final long numberOfExabytes
) {
4630 return exabyte(asBigInteger(numberOfExabytes
));
4634 * @param numberOfExabytes
4635 * The number of exabytes to create.
4636 * @return A new unit representing the given amount of exabytes.
4639 public static Exabyte
exabyte(@NonNull final BigInteger numberOfExabytes
) {
4640 return new Exabyte(multiplyNullsafe(BYTES_IN_A_EXABYTE
, numberOfExabytes
));
4644 * @param numberOfZettabytes
4645 * The number of zettabytes to create.
4646 * @return A new unit representing the given amount of zettabytes.
4649 public static Zettabyte
zettabyte(@NonNull final Long numberOfZettabytes
) {
4650 return zettabyte(numberOfZettabytes
.longValue());
4654 * @param numberOfZettabytes
4655 * The number of zettabytes to create.
4656 * @return A new unit representing the given amount of zettabytes.
4659 public static Zettabyte
zettabyte(final long numberOfZettabytes
) {
4660 return zettabyte(asBigInteger(numberOfZettabytes
));
4664 * @param numberOfZettabytes
4665 * The number of zettabytes to create.
4666 * @return A new unit representing the given amount of zettabytes.
4669 public static Zettabyte
zettabyte(@NonNull final BigInteger numberOfZettabytes
) {
4670 return new Zettabyte(multiplyNullsafe(BYTES_IN_A_ZETTABYTE
, numberOfZettabytes
));
4674 * @param numberOfYottabytes
4675 * The number of yottabytes to create.
4676 * @return A new unit representing the given amount of yottabytes.
4679 public static Yottabyte
yottabyte(@NonNull final Long numberOfYottabytes
) {
4680 return yottabyte(numberOfYottabytes
.longValue());
4684 * @param numberOfYottabytes
4685 * The number of yottabytes to create.
4686 * @return A new unit representing the given amount of yottabytes.
4689 public static Yottabyte
yottabyte(final long numberOfYottabytes
) {
4690 return yottabyte(asBigInteger(numberOfYottabytes
));
4694 * @param numberOfYottabytes
4695 * The number of yottabytes to create.
4696 * @return A new unit representing the given amount of yottabytes.
4699 public static Yottabyte
yottabyte(@NonNull final BigInteger numberOfYottabytes
) {
4700 return new Yottabyte(multiplyNullsafe(BYTES_IN_A_YOTTABYTE
, numberOfYottabytes
));
4704 * @param numberOfKilobytes
4705 * The number of kilobytes to create.
4706 * @return A new unit representing the given amount of kilobytes.
4709 public static CommonKilobyte
commonKilobyte(@NonNull final Long numberOfKilobytes
) {
4710 return commonKilobyte(numberOfKilobytes
.longValue());
4714 * @param numberOfKilobytes
4715 * The number of kilobytes to create.
4716 * @return A new unit representing the given amount of kilobytes.
4719 public static CommonKilobyte
commonKilobyte(final long numberOfKilobytes
) {
4720 return commonKilobyte(asBigInteger(numberOfKilobytes
));
4724 * @param numberOfKilobytes
4725 * The number of kilobytes to create.
4726 * @return A new unit representing the given amount of kilobytes.
4729 public static CommonKilobyte
commonKilobyte(@NonNull final BigInteger numberOfKilobytes
) {
4730 return new CommonKilobyte(multiplyNullsafe(BYTES_IN_A_KIBIBYTE
, numberOfKilobytes
));
4734 * @param numberOfMegabytes
4735 * The number of megabytes to create.
4736 * @return A new unit representing the given amount of megabytes.
4739 public static CommonMegabyte
commonMegabyte(@NonNull final Long numberOfMegabytes
) {
4740 return commonMegabyte(numberOfMegabytes
.longValue());
4744 * @param numberOfMegabytes
4745 * The number of megabytes to create.
4746 * @return A new unit representing the given amount of megabytes.
4749 public static CommonMegabyte
commonMegabyte(final long numberOfMegabytes
) {
4750 return commonMegabyte(asBigInteger(numberOfMegabytes
));
4754 * @param numberOfMegabytes
4755 * The number of megabytes to create.
4756 * @return A new unit representing the given amount of megabytes.
4759 public static CommonMegabyte
commonMegabyte(@NonNull final BigInteger numberOfMegabytes
) {
4760 return new CommonMegabyte(multiplyNullsafe(BYTES_IN_A_MEBIBYTE
, numberOfMegabytes
));
4764 * @param numberOfGigabytes
4765 * The number of gigabytes to create.
4766 * @return A new unit representing the given amount of gigabytes.
4769 public static CommonGigabyte
commonGigabyte(@NonNull final Long numberOfGigabytes
) {
4770 return commonGigabyte(numberOfGigabytes
.longValue());
4774 * @param numberOfGigabytes
4775 * The number of gigabytes to create.
4776 * @return A new unit representing the given amount of gigabytes.
4779 public static CommonGigabyte
commonGigabyte(final long numberOfGigabytes
) {
4780 return commonGigabyte(asBigInteger(numberOfGigabytes
));
4784 * @param numberOfGigabytes
4785 * The number of gigabytes to create.
4786 * @return A new unit representing the given amount of gigabytes.
4789 public static CommonGigabyte
commonGigabyte(@NonNull final BigInteger numberOfGigabytes
) {
4790 return new CommonGigabyte(multiplyNullsafe(BYTES_IN_A_GIBIBYTE
, numberOfGigabytes
));
4794 * @param numberOfTerabytes
4795 * The number of terabytes to create.
4796 * @return A new unit representing the given amount of terabytes.
4799 public static CommonTerabyte
commonTerabyte(@NonNull final Long numberOfTerabytes
) {
4800 return commonTerabyte(numberOfTerabytes
.longValue());
4804 * @param numberOfTerabytes
4805 * The number of terabytes to create.
4806 * @return A new unit representing the given amount of terabytes.
4809 public static CommonTerabyte
commonTerabyte(final long numberOfTerabytes
) {
4810 return commonTerabyte(asBigInteger(numberOfTerabytes
));
4814 * @param numberOfTerabytes
4815 * The number of terabytes to create.
4816 * @return A new unit representing the given amount of terabytes.
4819 public static CommonTerabyte
commonTerabyte(@NonNull final BigInteger numberOfTerabytes
) {
4820 return new CommonTerabyte(multiplyNullsafe(BYTES_IN_A_TEBIBYTE
, numberOfTerabytes
));
4824 * @param numberOfPetabytes
4825 * The number of petabytes to create.
4826 * @return A new unit representing the given amount of petabytes.
4829 public static CommonPetabyte
commonPetabyte(@NonNull final Long numberOfPetabytes
) {
4830 return commonPetabyte(numberOfPetabytes
.longValue());
4834 * @param numberOfPetabytes
4835 * The number of petabytes to create.
4836 * @return A new unit representing the given amount of petabytes.
4839 public static CommonPetabyte
commonPetabyte(final long numberOfPetabytes
) {
4840 return commonPetabyte(asBigInteger(numberOfPetabytes
));
4844 * @param numberOfPetabytes
4845 * The number of petabytes to create.
4846 * @return A new unit representing the given amount of petabytes.
4849 public static CommonPetabyte
commonPetabyte(@NonNull final BigInteger numberOfPetabytes
) {
4850 return new CommonPetabyte(multiplyNullsafe(BYTES_IN_A_PEBIBYTE
, numberOfPetabytes
));
4854 * @param numberOfExabytes
4855 * The number of exabytes to create.
4856 * @return A new unit representing the given amount of exabytes.
4859 public static CommonExabyte
commonExabyte(@NonNull final Long numberOfExabytes
) {
4860 return commonExabyte(numberOfExabytes
.longValue());
4864 * @param numberOfExabytes
4865 * The number of exabytes to create.
4866 * @return A new unit representing the given amount of exabytes.
4869 public static CommonExabyte
commonExabyte(final long numberOfExabytes
) {
4870 return commonExabyte(asBigInteger(numberOfExabytes
));
4874 * @param numberOfExabytes
4875 * The number of exabytes to create.
4876 * @return A new unit representing the given amount of exabytes.
4879 public static CommonExabyte
commonExabyte(@NonNull final BigInteger numberOfExabytes
) {
4880 return new CommonExabyte(multiplyNullsafe(BYTES_IN_A_EXBIBYTE
, numberOfExabytes
));
4884 * @param numberOfZettabytes
4885 * The number of zettabytes to create.
4886 * @return A new unit representing the given amount of zettabytes.
4889 public static CommonZettabyte
commonZettabyte(@NonNull final Long numberOfZettabytes
) {
4890 return commonZettabyte(numberOfZettabytes
.longValue());
4894 * @param numberOfZettabytes
4895 * The number of zettabytes to create.
4896 * @return A new unit representing the given amount of zettabytes.
4899 public static CommonZettabyte
commonZettabyte(final long numberOfZettabytes
) {
4900 return commonZettabyte(asBigInteger(numberOfZettabytes
));
4904 * @param numberOfZettabytes
4905 * The number of zettabytes to create.
4906 * @return A new unit representing the given amount of zettabytes.
4909 public static CommonZettabyte
commonZettabyte(@NonNull final BigInteger numberOfZettabytes
) {
4910 return new CommonZettabyte(multiplyNullsafe(BYTES_IN_A_ZEBIBYTE
, numberOfZettabytes
));
4914 * @param numberOfYottabytes
4915 * The number of yottabytes to create.
4916 * @return A new unit representing the given amount of yottabytes.
4919 public static CommonYottabyte
commonYottabyte(@NonNull final Long numberOfYottabytes
) {
4920 return commonYottabyte(numberOfYottabytes
.longValue());
4924 * @param numberOfYottabytes
4925 * The number of yottabytes to create.
4926 * @return A new unit representing the given amount of yottabytes.
4929 public static CommonYottabyte
commonYottabyte(final long numberOfYottabytes
) {
4930 return commonYottabyte(asBigInteger(numberOfYottabytes
));
4934 * @param numberOfYottabytes
4935 * The number of yottabytes to create.
4936 * @return A new unit representing the given amount of yottabytes.
4939 public static CommonYottabyte
commonYottabyte(@NonNull final BigInteger numberOfYottabytes
) {
4940 return new CommonYottabyte(multiplyNullsafe(BYTES_IN_A_YOBIBYTE
, numberOfYottabytes
));