fix #23
[storage-units.git] / src / main / java / de / xn__ho_hia / utils / storage_unit / StorageUnits.java
blob7c9f8948d609d04011edbd92e579daf80b5860d8
1 /*
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
5 * in the LICENSE file.
6 */
7 package de.xn__ho_hia.utils.storage_unit;
9 import static de.xn__ho_hia.quality.null_analysis.Nullsafe.asBigInteger;
10 import static de.xn__ho_hia.quality.null_analysis.Nullsafe.multiplyNullsafe;
11 import static de.xn__ho_hia.quality.null_analysis.Nullsafe.nonNull;
12 import static de.xn__ho_hia.utils.storage_unit.FormatUtils.asFormat;
13 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_EXABYTE;
14 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_EXBIBYTE;
15 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_GIBIBYTE;
16 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_GIGABYTE;
17 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_KIBIBYTE;
18 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_KILOBYTE;
19 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_MEBIBYTE;
20 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_MEGABYTE;
21 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_PEBIBYTE;
22 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_PETABYTE;
23 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_TEBIBYTE;
24 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_TERABYTE;
25 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_YOBIBYTE;
26 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_YOTTABYTE;
27 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_ZEBIBYTE;
28 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.BYTES_IN_A_ZETTABYTE;
29 import static de.xn__ho_hia.utils.storage_unit.StorageUnit.DEFAULT_FORMAT_PATTERN;
31 import java.math.BigInteger;
32 import java.text.DecimalFormat;
33 import java.text.Format;
34 import java.util.Locale;
36 import org.eclipse.jdt.annotation.NonNull;
38 /**
39 * Factory for storage units.
41 public final class StorageUnits {
43 private StorageUnits() {
44 // Hidden constructor.
47 /**
48 * @param bytes
49 * The amount to bytes to represent.
50 * @return The appropriate binary-prefixed unit for the given amount of bytes.
52 @NonNull
53 public static StorageUnit<?> binaryValueOf(final long bytes) {
54 return binaryValueOf(asBigInteger(bytes));
57 /**
58 * @param bytes
59 * The amount to bytes to represent.
60 * @return The appropriate binary-prefixed unit for the given amount of bytes.
62 @NonNull
63 public static StorageUnit<?> binaryValueOf(@NonNull final BigInteger bytes) {
64 StorageUnit<?> unit = Byte.valueOf(bytes);
65 @NonNull
66 final BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? nonNull(bytes.negate()) : bytes;
68 if (inbetween(BYTES_IN_A_KIBIBYTE, positiveNumberOfBytes, BYTES_IN_A_MEBIBYTE)) {
69 unit = unit.asKibibyte();
70 } else if (inbetween(BYTES_IN_A_MEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_GIBIBYTE)) {
71 unit = unit.asMebibyte();
72 } else if (inbetween(BYTES_IN_A_GIBIBYTE, positiveNumberOfBytes, BYTES_IN_A_TEBIBYTE)) {
73 unit = unit.asGibibyte();
74 } else if (inbetween(BYTES_IN_A_TEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_PEBIBYTE)) {
75 unit = unit.asTebibyte();
76 } else if (inbetween(BYTES_IN_A_PEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_EXBIBYTE)) {
77 unit = unit.asPebibyte();
78 } else if (inbetween(BYTES_IN_A_EXBIBYTE, positiveNumberOfBytes, BYTES_IN_A_ZEBIBYTE)) {
79 unit = unit.asExbibyte();
80 } else if (inbetween(BYTES_IN_A_ZEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_YOBIBYTE)) {
81 unit = unit.asZebibyte();
82 } else if (greaterThanEquals(positiveNumberOfBytes, BYTES_IN_A_YOBIBYTE)) {
83 unit = unit.asYobibyte();
86 return unit;
89 /**
90 * @param bytes
91 * The amount of bytes to represent.
92 * @return The appropriate metric-prefixed unit for the given amount of bytes.
94 @NonNull
95 public static StorageUnit<?> metricValueOf(final long bytes) {
96 return metricValueOf(asBigInteger(bytes));
99 /**
100 * @param bytes
101 * The amount of bytes to represent.
102 * @return The appropriate metric-prefixed unit for the given amount of bytes.
104 @NonNull
105 public static StorageUnit<?> metricValueOf(@NonNull final BigInteger bytes) {
106 StorageUnit<?> unit = Byte.valueOf(bytes);
107 @NonNull
108 final BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? nonNull(bytes.negate()) : bytes;
110 if (inbetween(BYTES_IN_A_KILOBYTE, positiveNumberOfBytes, BYTES_IN_A_MEGABYTE)) {
111 unit = unit.asKilobyte();
112 } else if (inbetween(BYTES_IN_A_MEGABYTE, positiveNumberOfBytes, BYTES_IN_A_GIGABYTE)) {
113 unit = unit.asMegabyte();
114 } else if (inbetween(BYTES_IN_A_GIGABYTE, positiveNumberOfBytes, BYTES_IN_A_TERABYTE)) {
115 unit = unit.asGigabyte();
116 } else if (inbetween(BYTES_IN_A_TERABYTE, positiveNumberOfBytes, BYTES_IN_A_PETABYTE)) {
117 unit = unit.asTerabyte();
118 } else if (inbetween(BYTES_IN_A_PETABYTE, positiveNumberOfBytes, BYTES_IN_A_EXABYTE)) {
119 unit = unit.asPetabyte();
120 } else if (inbetween(BYTES_IN_A_EXABYTE, positiveNumberOfBytes, BYTES_IN_A_ZETTABYTE)) {
121 unit = unit.asExabyte();
122 } else if (inbetween(BYTES_IN_A_ZETTABYTE, positiveNumberOfBytes, BYTES_IN_A_YOTTABYTE)) {
123 unit = unit.asZettabyte();
124 } else if (greaterThanEquals(positiveNumberOfBytes, BYTES_IN_A_YOTTABYTE)) {
125 unit = unit.asYottabyte();
128 return unit;
132 * @param bytes
133 * The amount to bytes to represent.
134 * @return The appropriate common unit for the given amount of bytes.
136 @NonNull
137 public static StorageUnit<?> commonValueOf(final long bytes) {
138 return commonValueOf(asBigInteger(bytes));
142 * @param bytes
143 * The amount to bytes to represent.
144 * @return The appropriate common unit for the given amount of bytes.
146 @NonNull
147 public static StorageUnit<?> commonValueOf(@NonNull final BigInteger bytes) {
148 StorageUnit<?> unit = Byte.valueOf(bytes);
149 @NonNull
150 final BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? nonNull(bytes.negate()) : bytes;
152 if (inbetween(BYTES_IN_A_KIBIBYTE, positiveNumberOfBytes, BYTES_IN_A_MEBIBYTE)) {
153 unit = unit.asCommonKilobyte();
154 } else if (inbetween(BYTES_IN_A_MEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_GIBIBYTE)) {
155 unit = unit.asCommonMegabyte();
156 } else if (inbetween(BYTES_IN_A_GIBIBYTE, positiveNumberOfBytes, BYTES_IN_A_TEBIBYTE)) {
157 unit = unit.asCommonGigabyte();
158 } else if (inbetween(BYTES_IN_A_TEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_PEBIBYTE)) {
159 unit = unit.asCommonTerabyte();
160 } else if (inbetween(BYTES_IN_A_PEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_EXBIBYTE)) {
161 unit = unit.asCommonPetabyte();
162 } else if (inbetween(BYTES_IN_A_EXBIBYTE, positiveNumberOfBytes, BYTES_IN_A_ZEBIBYTE)) {
163 unit = unit.asCommonExabyte();
164 } else if (inbetween(BYTES_IN_A_ZEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_YOBIBYTE)) {
165 unit = unit.asCommonZettabyte();
166 } else if (greaterThanEquals(positiveNumberOfBytes, BYTES_IN_A_YOBIBYTE)) {
167 unit = unit.asCommonYottabyte();
170 return unit;
173 private static boolean inbetween(final BigInteger start, final BigInteger value, final BigInteger endExclusive) {
174 return greaterThanEquals(value, start) && value.compareTo(endExclusive) < 0;
177 private static boolean greaterThanEquals(final BigInteger value, final BigInteger comparison) {
178 return value.compareTo(comparison) >= 0;
182 * @param numberOfBytes
183 * The amount of bytes to format.
184 * @return The formatted bytes using the default pattern.
186 @NonNull
187 public static String formatAsByte(@NonNull final Long numberOfBytes) {
188 return formatAsByte(numberOfBytes.longValue());
192 * @param numberOfBytes
193 * The amount of bytes to format.
194 * @return The formatted bytes using the default pattern.
196 @NonNull
197 public static String formatAsByte(final long numberOfBytes) {
198 return formatAsByte(asBigInteger(numberOfBytes));
202 * @param numberOfBytes
203 * The amount of bytes to format.
204 * @return The formatted bytes using the default pattern.
206 @NonNull
207 public static String formatAsByte(@NonNull final BigInteger numberOfBytes) {
208 return numberOfBytes.toString() + " B"; //$NON-NLS-1$
212 * @param numberOfBytes
213 * The amount of bytes to format.
214 * @return The formatted bytes using the default pattern.
216 @NonNull
217 public static String formatAsBinaryUnit(@NonNull final Long numberOfBytes) {
218 return formatAsBinaryUnit(numberOfBytes.longValue());
222 * @param numberOfBytes
223 * The amount of bytes to format.
224 * @return The formatted bytes using the default pattern.
226 @NonNull
227 public static String formatAsBinaryUnit(final long numberOfBytes) {
228 return formatAsBinaryUnit(asBigInteger(numberOfBytes));
232 * @param numberOfBytes
233 * The amount of bytes to format.
234 * @return The formatted bytes using the default pattern.
236 @NonNull
237 public static String formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes) {
238 return formatAsBinaryUnit(numberOfBytes, DEFAULT_FORMAT_PATTERN);
242 * @param numberOfBytes
243 * The amount of bytes to format.
244 * @param pattern
245 * The formatting pattern to apply.
246 * @return The formatted bytes using the default pattern.
248 @NonNull
249 public static String formatAsBinaryUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
250 return formatAsBinaryUnit(numberOfBytes.longValue(), pattern);
254 * @param numberOfBytes
255 * The amount of bytes to format.
256 * @param pattern
257 * The formatting pattern to apply.
258 * @return The formatted bytes using the default pattern.
260 @NonNull
261 public static String formatAsBinaryUnit(final long numberOfBytes, @NonNull final String pattern) {
262 return formatAsBinaryUnit(asBigInteger(numberOfBytes), pattern);
266 * @param numberOfBytes
267 * The amount of bytes to format.
268 * @param pattern
269 * The formatting pattern to apply.
270 * @return The formatted bytes using the default pattern.
272 @NonNull
273 public static String formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
274 return formatAsBinaryUnit(numberOfBytes, new DecimalFormat(pattern));
278 * @param numberOfBytes
279 * The amount of bytes to format.
280 * @param pattern
281 * The formatting pattern to apply.
282 * @param locale
283 * The locale to use.
284 * @return The formatted bytes using the default pattern.
286 @NonNull
287 public static String formatAsBinaryUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern,
288 @NonNull final Locale locale) {
289 return formatAsBinaryUnit(numberOfBytes.longValue(), pattern, locale);
293 * @param numberOfBytes
294 * The amount of bytes to format.
295 * @param pattern
296 * The formatting pattern to apply.
297 * @param locale
298 * The locale to use.
299 * @return The formatted bytes using the default pattern.
301 @NonNull
302 public static String formatAsBinaryUnit(final long numberOfBytes, @NonNull final String pattern,
303 @NonNull final Locale locale) {
304 return formatAsBinaryUnit(asBigInteger(numberOfBytes), pattern, locale);
308 * @param numberOfBytes
309 * The amount of bytes to format.
310 * @param pattern
311 * The formatting pattern to apply.
312 * @param locale
313 * The locale to use.
314 * @return The formatted bytes using the default pattern.
316 @NonNull
317 public static String formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
318 @NonNull final Locale locale) {
319 return formatAsBinaryUnit(numberOfBytes, asFormat(pattern, locale));
323 * @param numberOfBytes
324 * The amount of bytes to format.
325 * @param format
326 * The formatting pattern to apply.
327 * @return The formatted bytes using the default pattern.
329 @NonNull
330 public static String formatAsBinaryUnit(@NonNull final Long numberOfBytes, @NonNull final Format format) {
331 return formatAsBinaryUnit(numberOfBytes.longValue(), format);
335 * @param numberOfBytes
336 * The amount of bytes to format.
337 * @param format
338 * The formatting pattern to apply.
339 * @return The formatted bytes using the default pattern.
341 @NonNull
342 public static String formatAsBinaryUnit(final long numberOfBytes, @NonNull final Format format) {
343 return formatAsBinaryUnit(asBigInteger(numberOfBytes), format);
347 * @param numberOfBytes
348 * The amount of bytes to format.
349 * @param format
350 * The formatting pattern to apply.
351 * @return The formatted bytes using the default pattern.
353 @NonNull
354 public static String formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
355 return binaryValueOf(numberOfBytes).toString(format);
359 * @param numberOfBytes
360 * The amount of bytes to format.
361 * @return The formatted bytes using the default pattern.
363 @NonNull
364 public static String formatAsKibibyte(@NonNull final Long numberOfBytes) {
365 return formatAsKibibyte(numberOfBytes.longValue());
369 * @param numberOfBytes
370 * The amount of bytes to format.
371 * @return The formatted bytes using the default pattern.
373 @NonNull
374 public static String formatAsKibibyte(final long numberOfBytes) {
375 return formatAsKibibyte(asBigInteger(numberOfBytes));
379 * @param numberOfBytes
380 * The amount of bytes to format.
381 * @return The formatted bytes using the default pattern.
383 @NonNull
384 public static String formatAsKibibyte(@NonNull final BigInteger numberOfBytes) {
385 return formatAsKibibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
389 * @param numberOfBytes
390 * The amount of bytes to format.
391 * @param pattern
392 * The formatting pattern to apply.
393 * @return The formatted bytes using the default pattern.
395 @NonNull
396 public static String formatAsKibibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
397 return formatAsKibibyte(numberOfBytes.longValue(), pattern);
401 * @param numberOfBytes
402 * The amount of bytes to format.
403 * @param pattern
404 * The formatting pattern to apply.
405 * @return The formatted bytes using the default pattern.
407 @NonNull
408 public static String formatAsKibibyte(final long numberOfBytes, @NonNull final String pattern) {
409 return formatAsKibibyte(asBigInteger(numberOfBytes), pattern);
413 * @param numberOfBytes
414 * The amount of bytes to format.
415 * @param pattern
416 * The formatting pattern to apply.
417 * @return The formatted bytes using the default pattern.
419 @NonNull
420 public static String formatAsKibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
421 return formatAsKibibyte(numberOfBytes, new DecimalFormat(pattern));
425 * @param numberOfBytes
426 * The amount of bytes to format.
427 * @param pattern
428 * The formatting pattern to apply.
429 * @param locale
430 * The locale to use.
431 * @return The formatted bytes using the default pattern.
433 @NonNull
434 public static String formatAsKibibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
435 @NonNull final Locale locale) {
436 return formatAsKibibyte(numberOfBytes.longValue(), pattern, locale);
440 * @param numberOfBytes
441 * The amount of bytes to format.
442 * @param pattern
443 * The formatting pattern to apply.
444 * @param locale
445 * The locale to use.
446 * @return The formatted bytes using the default pattern.
448 @NonNull
449 public static String formatAsKibibyte(final long numberOfBytes, @NonNull final String pattern,
450 @NonNull final Locale locale) {
451 return formatAsKibibyte(asBigInteger(numberOfBytes), pattern, locale);
455 * @param numberOfBytes
456 * The amount of bytes to format.
457 * @param pattern
458 * The formatting pattern to apply.
459 * @param locale
460 * The locale to use.
461 * @return The formatted bytes using the default pattern.
463 @NonNull
464 public static String formatAsKibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
465 @NonNull final Locale locale) {
466 return formatAsKibibyte(numberOfBytes, asFormat(pattern, locale));
470 * @param numberOfBytes
471 * The amount of bytes to format.
472 * @param format
473 * The formatting pattern to apply.
474 * @return The formatted bytes using the default pattern.
476 @NonNull
477 public static String formatAsKibibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
478 return formatAsKibibyte(numberOfBytes.longValue(), format);
482 * @param numberOfBytes
483 * The amount of bytes to format.
484 * @param format
485 * The formatting pattern to apply.
486 * @return The formatted bytes using the default pattern.
488 @NonNull
489 public static String formatAsKibibyte(final long numberOfBytes, @NonNull final Format format) {
490 return formatAsKibibyte(asBigInteger(numberOfBytes), format);
494 * @param numberOfBytes
495 * The amount of bytes to format.
496 * @param format
497 * The formatting pattern to apply.
498 * @return The formatted bytes using the default pattern.
500 @NonNull
501 public static String formatAsKibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
502 return Kibibyte.valueOf(numberOfBytes).toString(format);
506 * @param numberOfBytes
507 * The amount of bytes to format.
508 * @return The formatted bytes using the default pattern.
510 @NonNull
511 public static String formatAsMebibyte(@NonNull final Long numberOfBytes) {
512 return formatAsMebibyte(numberOfBytes.longValue());
516 * @param numberOfBytes
517 * The amount of bytes to format.
518 * @return The formatted bytes using the default pattern.
520 @NonNull
521 public static String formatAsMebibyte(final long numberOfBytes) {
522 return formatAsMebibyte(asBigInteger(numberOfBytes));
526 * @param numberOfBytes
527 * The amount of bytes to format.
528 * @return The formatted bytes using the default pattern.
530 @NonNull
531 public static String formatAsMebibyte(@NonNull final BigInteger numberOfBytes) {
532 return formatAsMebibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
536 * @param numberOfBytes
537 * The amount of bytes to format.
538 * @param pattern
539 * The formatting pattern to apply.
540 * @return The formatted bytes using the default pattern.
542 @NonNull
543 public static String formatAsMebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
544 return formatAsMebibyte(numberOfBytes.longValue(), pattern);
548 * @param numberOfBytes
549 * The amount of bytes to format.
550 * @param pattern
551 * The formatting pattern to apply.
552 * @return The formatted bytes using the default pattern.
554 @NonNull
555 public static String formatAsMebibyte(final long numberOfBytes, @NonNull final String pattern) {
556 return formatAsMebibyte(asBigInteger(numberOfBytes), pattern);
560 * @param numberOfBytes
561 * The amount of bytes to format.
562 * @param pattern
563 * The formatting pattern to apply.
564 * @return The formatted bytes using the default pattern.
566 @NonNull
567 public static String formatAsMebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
568 return formatAsMebibyte(numberOfBytes, new DecimalFormat(pattern));
572 * @param numberOfBytes
573 * The amount of bytes to format.
574 * @param pattern
575 * The formatting pattern to apply.
576 * @param locale
577 * The locale to use.
578 * @return The formatted bytes using the default pattern.
580 @NonNull
581 public static String formatAsMebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
582 @NonNull final Locale locale) {
583 return formatAsMebibyte(numberOfBytes.longValue(), pattern, locale);
587 * @param numberOfBytes
588 * The amount of bytes to format.
589 * @param pattern
590 * The formatting pattern to apply.
591 * @param locale
592 * The locale to use.
593 * @return The formatted bytes using the default pattern.
595 @NonNull
596 public static String formatAsMebibyte(final long numberOfBytes, @NonNull final String pattern,
597 @NonNull final Locale locale) {
598 return formatAsMebibyte(asBigInteger(numberOfBytes), pattern, locale);
602 * @param numberOfBytes
603 * The amount of bytes to format.
604 * @param pattern
605 * The formatting pattern to apply.
606 * @param locale
607 * The locale to use.
608 * @return The formatted bytes using the default pattern.
610 @NonNull
611 public static String formatAsMebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
612 @NonNull final Locale locale) {
613 return formatAsMebibyte(numberOfBytes, asFormat(pattern, locale));
617 * @param numberOfBytes
618 * The amount of bytes to format.
619 * @param format
620 * The formatting pattern to apply.
621 * @return The formatted bytes using the default pattern.
623 @NonNull
624 public static String formatAsMebibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
625 return formatAsMebibyte(numberOfBytes.longValue(), format);
629 * @param numberOfBytes
630 * The amount of bytes to format.
631 * @param format
632 * The formatting pattern to apply.
633 * @return The formatted bytes using the default pattern.
635 @NonNull
636 public static String formatAsMebibyte(final long numberOfBytes, @NonNull final Format format) {
637 return formatAsMebibyte(asBigInteger(numberOfBytes), format);
641 * @param numberOfBytes
642 * The amount of bytes to format.
643 * @param format
644 * The formatting pattern to apply.
645 * @return The formatted bytes using the default pattern.
647 @NonNull
648 public static String formatAsMebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
649 return Mebibyte.valueOf(numberOfBytes).toString(format);
653 * @param numberOfBytes
654 * The amount of bytes to format.
655 * @return The formatted bytes using the default pattern.
657 @NonNull
658 public static String formatAsGibibyte(@NonNull final Long numberOfBytes) {
659 return formatAsGibibyte(numberOfBytes.longValue());
663 * @param numberOfBytes
664 * The amount of bytes to format.
665 * @return The formatted bytes using the default pattern.
667 @NonNull
668 public static String formatAsGibibyte(final long numberOfBytes) {
669 return formatAsGibibyte(asBigInteger(numberOfBytes));
673 * @param numberOfBytes
674 * The amount of bytes to format.
675 * @return The formatted bytes using the default pattern.
677 @NonNull
678 public static String formatAsGibibyte(@NonNull final BigInteger numberOfBytes) {
679 return formatAsGibibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
683 * @param numberOfBytes
684 * The amount of bytes to format.
685 * @param pattern
686 * The formatting pattern to apply.
687 * @return The formatted bytes using the default pattern.
689 @NonNull
690 public static String formatAsGibibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
691 return formatAsGibibyte(numberOfBytes.longValue(), pattern);
695 * @param numberOfBytes
696 * The amount of bytes to format.
697 * @param pattern
698 * The formatting pattern to apply.
699 * @return The formatted bytes using the default pattern.
701 @NonNull
702 public static String formatAsGibibyte(final long numberOfBytes, @NonNull final String pattern) {
703 return formatAsGibibyte(asBigInteger(numberOfBytes), pattern);
707 * @param numberOfBytes
708 * The amount of bytes to format.
709 * @param pattern
710 * The formatting pattern to apply.
711 * @return The formatted bytes using the default pattern.
713 @NonNull
714 public static String formatAsGibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
715 return formatAsGibibyte(numberOfBytes, new DecimalFormat(pattern));
719 * @param numberOfBytes
720 * The amount of bytes to format.
721 * @param pattern
722 * The formatting pattern to apply.
723 * @param locale
724 * The locale to use.
725 * @return The formatted bytes using the default pattern.
727 @NonNull
728 public static String formatAsGibibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
729 @NonNull final Locale locale) {
730 return formatAsGibibyte(numberOfBytes.longValue(), pattern, locale);
734 * @param numberOfBytes
735 * The amount of bytes to format.
736 * @param pattern
737 * The formatting pattern to apply.
738 * @param locale
739 * The locale to use.
740 * @return The formatted bytes using the default pattern.
742 @NonNull
743 public static String formatAsGibibyte(final long numberOfBytes, @NonNull final String pattern,
744 @NonNull final Locale locale) {
745 return formatAsGibibyte(asBigInteger(numberOfBytes), pattern, locale);
749 * @param numberOfBytes
750 * The amount of bytes to format.
751 * @param pattern
752 * The formatting pattern to apply.
753 * @param locale
754 * The locale to use.
755 * @return The formatted bytes using the default pattern.
757 @NonNull
758 public static String formatAsGibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
759 @NonNull final Locale locale) {
760 return formatAsGibibyte(numberOfBytes, asFormat(pattern, locale));
764 * @param numberOfBytes
765 * The amount of bytes to format.
766 * @param format
767 * The formatting pattern to apply.
768 * @return The formatted bytes using the default pattern.
770 @NonNull
771 public static String formatAsGibibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
772 return formatAsGibibyte(numberOfBytes.longValue(), format);
776 * @param numberOfBytes
777 * The amount of bytes to format.
778 * @param format
779 * The formatting pattern to apply.
780 * @return The formatted bytes using the default pattern.
782 @NonNull
783 public static String formatAsGibibyte(final long numberOfBytes, @NonNull final Format format) {
784 return formatAsGibibyte(asBigInteger(numberOfBytes), format);
788 * @param numberOfBytes
789 * The amount of bytes to format.
790 * @param format
791 * The formatting pattern to apply.
792 * @return The formatted bytes using the default pattern.
794 @NonNull
795 public static String formatAsGibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
796 return Gibibyte.valueOf(numberOfBytes).toString(format);
800 * @param numberOfBytes
801 * The amount of bytes to format.
802 * @return The formatted bytes using the default pattern.
804 @NonNull
805 public static String formatAsTebibyte(@NonNull final Long numberOfBytes) {
806 return formatAsTebibyte(numberOfBytes.longValue());
810 * @param numberOfBytes
811 * The amount of bytes to format.
812 * @return The formatted bytes using the default pattern.
814 @NonNull
815 public static String formatAsTebibyte(final long numberOfBytes) {
816 return formatAsTebibyte(asBigInteger(numberOfBytes));
820 * @param numberOfBytes
821 * The amount of bytes to format.
822 * @return The formatted bytes using the default pattern.
824 @NonNull
825 public static String formatAsTebibyte(@NonNull final BigInteger numberOfBytes) {
826 return formatAsTebibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
830 * @param numberOfBytes
831 * The amount of bytes to format.
832 * @param pattern
833 * The formatting pattern to apply.
834 * @return The formatted bytes using the default pattern.
836 @NonNull
837 public static String formatAsTebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
838 return formatAsTebibyte(numberOfBytes.longValue(), pattern);
842 * @param numberOfBytes
843 * The amount of bytes to format.
844 * @param pattern
845 * The formatting pattern to apply.
846 * @return The formatted bytes using the default pattern.
848 @NonNull
849 public static String formatAsTebibyte(final long numberOfBytes, @NonNull final String pattern) {
850 return formatAsTebibyte(asBigInteger(numberOfBytes), pattern);
854 * @param numberOfBytes
855 * The amount of bytes to format.
856 * @param pattern
857 * The formatting pattern to apply.
858 * @return The formatted bytes using the default pattern.
860 @NonNull
861 public static String formatAsTebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
862 return formatAsTebibyte(numberOfBytes, new DecimalFormat(pattern));
866 * @param numberOfBytes
867 * The amount of bytes to format.
868 * @param pattern
869 * The formatting pattern to apply.
870 * @param locale
871 * The locale to use.
872 * @return The formatted bytes using the default pattern.
874 @NonNull
875 public static String formatAsTebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
876 @NonNull final Locale locale) {
877 return formatAsTebibyte(numberOfBytes.longValue(), pattern, locale);
881 * @param numberOfBytes
882 * The amount of bytes to format.
883 * @param pattern
884 * The formatting pattern to apply.
885 * @param locale
886 * The locale to use.
887 * @return The formatted bytes using the default pattern.
889 @NonNull
890 public static String formatAsTebibyte(final long numberOfBytes, @NonNull final String pattern,
891 @NonNull final Locale locale) {
892 return formatAsTebibyte(asBigInteger(numberOfBytes), pattern, locale);
896 * @param numberOfBytes
897 * The amount of bytes to format.
898 * @param pattern
899 * The formatting pattern to apply.
900 * @param locale
901 * The locale to use.
902 * @return The formatted bytes using the default pattern.
904 @NonNull
905 public static String formatAsTebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
906 @NonNull final Locale locale) {
907 return formatAsTebibyte(numberOfBytes, asFormat(pattern, locale));
911 * @param numberOfBytes
912 * The amount of bytes to format.
913 * @param format
914 * The formatting pattern to apply.
915 * @return The formatted bytes using the default pattern.
917 @NonNull
918 public static String formatAsTebibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
919 return formatAsTebibyte(numberOfBytes.longValue(), format);
923 * @param numberOfBytes
924 * The amount of bytes to format.
925 * @param format
926 * The formatting pattern to apply.
927 * @return The formatted bytes using the default pattern.
929 @NonNull
930 public static String formatAsTebibyte(final long numberOfBytes, @NonNull final Format format) {
931 return formatAsTebibyte(asBigInteger(numberOfBytes), format);
935 * @param numberOfBytes
936 * The amount of bytes to format.
937 * @param format
938 * The formatting pattern to apply.
939 * @return The formatted bytes using the default pattern.
941 @NonNull
942 public static String formatAsTebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
943 return Tebibyte.valueOf(numberOfBytes).toString(format);
947 * @param numberOfBytes
948 * The amount of bytes to format.
949 * @return The formatted bytes using the default pattern.
951 @NonNull
952 public static String formatAsPebibyte(@NonNull final Long numberOfBytes) {
953 return formatAsPebibyte(numberOfBytes.longValue());
957 * @param numberOfBytes
958 * The amount of bytes to format.
959 * @return The formatted bytes using the default pattern.
961 @NonNull
962 public static String formatAsPebibyte(final long numberOfBytes) {
963 return formatAsPebibyte(asBigInteger(numberOfBytes));
967 * @param numberOfBytes
968 * The amount of bytes to format.
969 * @return The formatted bytes using the default pattern.
971 @NonNull
972 public static String formatAsPebibyte(@NonNull final BigInteger numberOfBytes) {
973 return formatAsPebibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
977 * @param numberOfBytes
978 * The amount of bytes to format.
979 * @param pattern
980 * The formatting pattern to apply.
981 * @return The formatted bytes using the default pattern.
983 @NonNull
984 public static String formatAsPebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
985 return formatAsPebibyte(numberOfBytes.longValue(), pattern);
989 * @param numberOfBytes
990 * The amount of bytes to format.
991 * @param pattern
992 * The formatting pattern to apply.
993 * @return The formatted bytes using the default pattern.
995 @NonNull
996 public static String formatAsPebibyte(final long numberOfBytes, @NonNull final String pattern) {
997 return formatAsPebibyte(asBigInteger(numberOfBytes), pattern);
1001 * @param numberOfBytes
1002 * The amount of bytes to format.
1003 * @param pattern
1004 * The formatting pattern to apply.
1005 * @return The formatted bytes using the default pattern.
1007 @NonNull
1008 public static String formatAsPebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1009 return formatAsPebibyte(numberOfBytes, new DecimalFormat(pattern));
1013 * @param numberOfBytes
1014 * The amount of bytes to format.
1015 * @param pattern
1016 * The formatting pattern to apply.
1017 * @param locale
1018 * The locale to use.
1019 * @return The formatted bytes using the default pattern.
1021 @NonNull
1022 public static String formatAsPebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1023 @NonNull final Locale locale) {
1024 return formatAsPebibyte(numberOfBytes.longValue(), pattern, locale);
1028 * @param numberOfBytes
1029 * The amount of bytes to format.
1030 * @param pattern
1031 * The formatting pattern to apply.
1032 * @param locale
1033 * The locale to use.
1034 * @return The formatted bytes using the default pattern.
1036 @NonNull
1037 public static String formatAsPebibyte(final long numberOfBytes, @NonNull final String pattern,
1038 @NonNull final Locale locale) {
1039 return formatAsPebibyte(asBigInteger(numberOfBytes), pattern, locale);
1043 * @param numberOfBytes
1044 * The amount of bytes to format.
1045 * @param pattern
1046 * The formatting pattern to apply.
1047 * @param locale
1048 * The locale to use.
1049 * @return The formatted bytes using the default pattern.
1051 @NonNull
1052 public static String formatAsPebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1053 @NonNull final Locale locale) {
1054 return formatAsPebibyte(numberOfBytes, asFormat(pattern, locale));
1058 * @param numberOfBytes
1059 * The amount of bytes to format.
1060 * @param format
1061 * The formatting pattern to apply.
1062 * @return The formatted bytes using the default pattern.
1064 @NonNull
1065 public static String formatAsPebibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1066 return formatAsPebibyte(numberOfBytes.longValue(), format);
1070 * @param numberOfBytes
1071 * The amount of bytes to format.
1072 * @param format
1073 * The formatting pattern to apply.
1074 * @return The formatted bytes using the default pattern.
1076 @NonNull
1077 public static String formatAsPebibyte(final long numberOfBytes, @NonNull final Format format) {
1078 return formatAsPebibyte(asBigInteger(numberOfBytes), format);
1082 * @param numberOfBytes
1083 * The amount of bytes to format.
1084 * @param format
1085 * The formatting pattern to apply.
1086 * @return The formatted bytes using the default pattern.
1088 @NonNull
1089 public static String formatAsPebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1090 return Pebibyte.valueOf(numberOfBytes).toString(format);
1094 * @param numberOfBytes
1095 * The amount of bytes to format.
1096 * @return The formatted bytes using the default pattern.
1098 @NonNull
1099 public static String formatAsExbibyte(@NonNull final Long numberOfBytes) {
1100 return formatAsExbibyte(numberOfBytes.longValue());
1104 * @param numberOfBytes
1105 * The amount of bytes to format.
1106 * @return The formatted bytes using the default pattern.
1108 @NonNull
1109 public static String formatAsExbibyte(final long numberOfBytes) {
1110 return formatAsExbibyte(asBigInteger(numberOfBytes));
1114 * @param numberOfBytes
1115 * The amount of bytes to format.
1116 * @return The formatted bytes using the default pattern.
1118 @NonNull
1119 public static String formatAsExbibyte(@NonNull final BigInteger numberOfBytes) {
1120 return formatAsExbibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1124 * @param numberOfBytes
1125 * The amount of bytes to format.
1126 * @param pattern
1127 * The formatting pattern to apply.
1128 * @return The formatted bytes using the default pattern.
1130 @NonNull
1131 public static String formatAsExbibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1132 return formatAsExbibyte(numberOfBytes.longValue(), pattern);
1136 * @param numberOfBytes
1137 * The amount of bytes to format.
1138 * @param pattern
1139 * The formatting pattern to apply.
1140 * @return The formatted bytes using the default pattern.
1142 @NonNull
1143 public static String formatAsExbibyte(final long numberOfBytes, @NonNull final String pattern) {
1144 return formatAsExbibyte(asBigInteger(numberOfBytes), pattern);
1148 * @param numberOfBytes
1149 * The amount of bytes to format.
1150 * @param pattern
1151 * The formatting pattern to apply.
1152 * @return The formatted bytes using the default pattern.
1154 @NonNull
1155 public static String formatAsExbibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1156 return formatAsExbibyte(numberOfBytes, new DecimalFormat(pattern));
1160 * @param numberOfBytes
1161 * The amount of bytes to format.
1162 * @param pattern
1163 * The formatting pattern to apply.
1164 * @param locale
1165 * The locale to use.
1166 * @return The formatted bytes using the default pattern.
1168 @NonNull
1169 public static String formatAsExbibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1170 @NonNull final Locale locale) {
1171 return formatAsExbibyte(numberOfBytes.longValue(), pattern, locale);
1175 * @param numberOfBytes
1176 * The amount of bytes to format.
1177 * @param pattern
1178 * The formatting pattern to apply.
1179 * @param locale
1180 * The locale to use.
1181 * @return The formatted bytes using the default pattern.
1183 @NonNull
1184 public static String formatAsExbibyte(final long numberOfBytes, @NonNull final String pattern,
1185 @NonNull final Locale locale) {
1186 return formatAsExbibyte(asBigInteger(numberOfBytes), pattern, locale);
1190 * @param numberOfBytes
1191 * The amount of bytes to format.
1192 * @param pattern
1193 * The formatting pattern to apply.
1194 * @param locale
1195 * The locale to use.
1196 * @return The formatted bytes using the default pattern.
1198 @NonNull
1199 public static String formatAsExbibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1200 @NonNull final Locale locale) {
1201 return formatAsExbibyte(numberOfBytes, asFormat(pattern, locale));
1205 * @param numberOfBytes
1206 * The amount of bytes to format.
1207 * @param format
1208 * The formatting pattern to apply.
1209 * @return The formatted bytes using the default pattern.
1211 @NonNull
1212 public static String formatAsExbibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1213 return formatAsExbibyte(numberOfBytes.longValue(), format);
1217 * @param numberOfBytes
1218 * The amount of bytes to format.
1219 * @param format
1220 * The formatting pattern to apply.
1221 * @return The formatted bytes using the default pattern.
1223 @NonNull
1224 public static String formatAsExbibyte(final long numberOfBytes, @NonNull final Format format) {
1225 return formatAsExbibyte(asBigInteger(numberOfBytes), format);
1229 * @param numberOfBytes
1230 * The amount of bytes to format.
1231 * @param format
1232 * The formatting pattern to apply.
1233 * @return The formatted bytes using the default pattern.
1235 @NonNull
1236 public static String formatAsExbibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1237 return Exbibyte.valueOf(numberOfBytes).toString(format);
1241 * @param numberOfBytes
1242 * The amount of bytes to format.
1243 * @return The formatted bytes using the default pattern.
1245 @NonNull
1246 public static String formatAsZebibyte(@NonNull final Long numberOfBytes) {
1247 return formatAsZebibyte(numberOfBytes.longValue());
1251 * @param numberOfBytes
1252 * The amount of bytes to format.
1253 * @return The formatted bytes using the default pattern.
1255 @NonNull
1256 public static String formatAsZebibyte(final long numberOfBytes) {
1257 return formatAsZebibyte(asBigInteger(numberOfBytes));
1261 * @param numberOfBytes
1262 * The amount of bytes to format.
1263 * @return The formatted bytes using the default pattern.
1265 @NonNull
1266 public static String formatAsZebibyte(@NonNull final BigInteger numberOfBytes) {
1267 return formatAsZebibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1271 * @param numberOfBytes
1272 * The amount of bytes to format.
1273 * @param pattern
1274 * The formatting pattern to apply.
1275 * @return The formatted bytes using the default pattern.
1277 @NonNull
1278 public static String formatAsZebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1279 return formatAsZebibyte(numberOfBytes.longValue(), pattern);
1283 * @param numberOfBytes
1284 * The amount of bytes to format.
1285 * @param pattern
1286 * The formatting pattern to apply.
1287 * @return The formatted bytes using the default pattern.
1289 @NonNull
1290 public static String formatAsZebibyte(final long numberOfBytes, @NonNull final String pattern) {
1291 return formatAsZebibyte(asBigInteger(numberOfBytes), pattern);
1295 * @param numberOfBytes
1296 * The amount of bytes to format.
1297 * @param pattern
1298 * The formatting pattern to apply.
1299 * @return The formatted bytes using the default pattern.
1301 @NonNull
1302 public static String formatAsZebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1303 return formatAsZebibyte(numberOfBytes, new DecimalFormat(pattern));
1307 * @param numberOfBytes
1308 * The amount of bytes to format.
1309 * @param pattern
1310 * The formatting pattern to apply.
1311 * @param locale
1312 * The locale to use.
1313 * @return The formatted bytes using the default pattern.
1315 @NonNull
1316 public static String formatAsZebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1317 @NonNull final Locale locale) {
1318 return formatAsZebibyte(numberOfBytes.longValue(), pattern, locale);
1322 * @param numberOfBytes
1323 * The amount of bytes to format.
1324 * @param pattern
1325 * The formatting pattern to apply.
1326 * @param locale
1327 * The locale to use.
1328 * @return The formatted bytes using the default pattern.
1330 @NonNull
1331 public static String formatAsZebibyte(final long numberOfBytes, @NonNull final String pattern,
1332 @NonNull final Locale locale) {
1333 return formatAsZebibyte(asBigInteger(numberOfBytes), pattern, locale);
1337 * @param numberOfBytes
1338 * The amount of bytes to format.
1339 * @param pattern
1340 * The formatting pattern to apply.
1341 * @param locale
1342 * The locale to use.
1343 * @return The formatted bytes using the default pattern.
1345 @NonNull
1346 public static String formatAsZebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1347 @NonNull final Locale locale) {
1348 return formatAsZebibyte(numberOfBytes, asFormat(pattern, locale));
1352 * @param numberOfBytes
1353 * The amount of bytes to format.
1354 * @param format
1355 * The formatting pattern to apply.
1356 * @return The formatted bytes using the default pattern.
1358 @NonNull
1359 public static String formatAsZebibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1360 return formatAsZebibyte(numberOfBytes.longValue(), format);
1364 * @param numberOfBytes
1365 * The amount of bytes to format.
1366 * @param format
1367 * The formatting pattern to apply.
1368 * @return The formatted bytes using the default pattern.
1370 @NonNull
1371 public static String formatAsZebibyte(final long numberOfBytes, @NonNull final Format format) {
1372 return formatAsZebibyte(asBigInteger(numberOfBytes), format);
1376 * @param numberOfBytes
1377 * The amount of bytes to format.
1378 * @param format
1379 * The formatting pattern to apply.
1380 * @return The formatted bytes using the default pattern.
1382 @NonNull
1383 public static String formatAsZebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1384 return Zebibyte.valueOf(numberOfBytes).toString(format);
1388 * @param numberOfBytes
1389 * The amount of bytes to format.
1390 * @return The formatted bytes using the default pattern.
1392 @NonNull
1393 public static String formatAsYobibyte(@NonNull final Long numberOfBytes) {
1394 return formatAsYobibyte(numberOfBytes.longValue());
1398 * @param numberOfBytes
1399 * The amount of bytes to format.
1400 * @return The formatted bytes using the default pattern.
1402 @NonNull
1403 public static String formatAsYobibyte(final long numberOfBytes) {
1404 return formatAsYobibyte(asBigInteger(numberOfBytes));
1408 * @param numberOfBytes
1409 * The amount of bytes to format.
1410 * @return The formatted bytes using the default pattern.
1412 @NonNull
1413 public static String formatAsYobibyte(@NonNull final BigInteger numberOfBytes) {
1414 return formatAsYobibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1418 * @param numberOfBytes
1419 * The amount of bytes to format.
1420 * @param pattern
1421 * The formatting pattern to apply.
1422 * @return The formatted bytes using the default pattern.
1424 @NonNull
1425 public static String formatAsYobibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1426 return formatAsYobibyte(numberOfBytes.longValue(), pattern);
1430 * @param numberOfBytes
1431 * The amount of bytes to format.
1432 * @param pattern
1433 * The formatting pattern to apply.
1434 * @return The formatted bytes using the default pattern.
1436 @NonNull
1437 public static String formatAsYobibyte(final long numberOfBytes, @NonNull final String pattern) {
1438 return formatAsYobibyte(asBigInteger(numberOfBytes), pattern);
1442 * @param numberOfBytes
1443 * The amount of bytes to format.
1444 * @param pattern
1445 * The formatting pattern to apply.
1446 * @return The formatted bytes using the default pattern.
1448 @NonNull
1449 public static String formatAsYobibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1450 return formatAsYobibyte(numberOfBytes, new DecimalFormat(pattern));
1454 * @param numberOfBytes
1455 * The amount of bytes to format.
1456 * @param pattern
1457 * The formatting pattern to apply.
1458 * @param locale
1459 * The locale to use.
1460 * @return The formatted bytes using the default pattern.
1462 @NonNull
1463 public static String formatAsYobibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1464 @NonNull final Locale locale) {
1465 return formatAsYobibyte(numberOfBytes.longValue(), pattern, locale);
1469 * @param numberOfBytes
1470 * The amount of bytes to format.
1471 * @param pattern
1472 * The formatting pattern to apply.
1473 * @param locale
1474 * The locale to use.
1475 * @return The formatted bytes using the default pattern.
1477 @NonNull
1478 public static String formatAsYobibyte(final long numberOfBytes, @NonNull final String pattern,
1479 @NonNull final Locale locale) {
1480 return formatAsYobibyte(asBigInteger(numberOfBytes), pattern, locale);
1484 * @param numberOfBytes
1485 * The amount of bytes to format.
1486 * @param pattern
1487 * The formatting pattern to apply.
1488 * @param locale
1489 * The locale to use.
1490 * @return The formatted bytes using the default pattern.
1492 @NonNull
1493 public static String formatAsYobibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1494 @NonNull final Locale locale) {
1495 return formatAsYobibyte(numberOfBytes, asFormat(pattern, locale));
1499 * @param numberOfBytes
1500 * The amount of bytes to format.
1501 * @param format
1502 * The formatting pattern to apply.
1503 * @return The formatted bytes using the default pattern.
1505 @NonNull
1506 public static String formatAsYobibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1507 return formatAsYobibyte(numberOfBytes.longValue(), format);
1511 * @param numberOfBytes
1512 * The amount of bytes to format.
1513 * @param format
1514 * The formatting pattern to apply.
1515 * @return The formatted bytes using the default pattern.
1517 @NonNull
1518 public static String formatAsYobibyte(final long numberOfBytes, @NonNull final Format format) {
1519 return formatAsYobibyte(asBigInteger(numberOfBytes), format);
1523 * @param numberOfBytes
1524 * The amount of bytes to format.
1525 * @param format
1526 * The formatting pattern to apply.
1527 * @return The formatted bytes using the default pattern.
1529 @NonNull
1530 public static String formatAsYobibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1531 return Yobibyte.valueOf(numberOfBytes).toString(format);
1535 * @param numberOfBytes
1536 * The amount of bytes to format.
1537 * @return The formatted bytes using the default pattern.
1539 @NonNull
1540 public static String formatAsMetricUnit(@NonNull final Long numberOfBytes) {
1541 return formatAsMetricUnit(numberOfBytes.longValue());
1545 * @param numberOfBytes
1546 * The amount of bytes to format.
1547 * @return The formatted bytes using the default pattern.
1549 @NonNull
1550 public static String formatAsMetricUnit(final long numberOfBytes) {
1551 return formatAsMetricUnit(asBigInteger(numberOfBytes));
1555 * @param numberOfBytes
1556 * The amount of bytes to format.
1557 * @return The formatted bytes using the default pattern.
1559 @NonNull
1560 public static String formatAsMetricUnit(@NonNull final BigInteger numberOfBytes) {
1561 return formatAsMetricUnit(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1565 * @param numberOfBytes
1566 * The amount of bytes to format.
1567 * @param pattern
1568 * The formatting pattern to apply.
1569 * @return The formatted bytes using the default pattern.
1571 @NonNull
1572 public static String formatAsMetricUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1573 return formatAsMetricUnit(numberOfBytes.longValue(), pattern);
1577 * @param numberOfBytes
1578 * The amount of bytes to format.
1579 * @param pattern
1580 * The formatting pattern to apply.
1581 * @return The formatted bytes using the default pattern.
1583 @NonNull
1584 public static String formatAsMetricUnit(final long numberOfBytes, @NonNull final String pattern) {
1585 return formatAsMetricUnit(asBigInteger(numberOfBytes), pattern);
1589 * @param numberOfBytes
1590 * The amount of bytes to format.
1591 * @param pattern
1592 * The formatting pattern to apply.
1593 * @return The formatted bytes using the default pattern.
1595 @NonNull
1596 public static String formatAsMetricUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1597 return formatAsMetricUnit(numberOfBytes, new DecimalFormat(pattern));
1601 * @param numberOfBytes
1602 * The amount of bytes to format.
1603 * @param pattern
1604 * The formatting pattern to apply.
1605 * @param locale
1606 * The locale to use.
1607 * @return The formatted bytes using the default pattern.
1609 @NonNull
1610 public static String formatAsMetricUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1611 @NonNull final Locale locale) {
1612 return formatAsMetricUnit(numberOfBytes.longValue(), pattern, locale);
1616 * @param numberOfBytes
1617 * The amount of bytes to format.
1618 * @param pattern
1619 * The formatting pattern to apply.
1620 * @param locale
1621 * The locale to use.
1622 * @return The formatted bytes using the default pattern.
1624 @NonNull
1625 public static String formatAsMetricUnit(final long numberOfBytes, @NonNull final String pattern,
1626 @NonNull final Locale locale) {
1627 return formatAsMetricUnit(asBigInteger(numberOfBytes), pattern, locale);
1631 * @param numberOfBytes
1632 * The amount of bytes to format.
1633 * @param pattern
1634 * The formatting pattern to apply.
1635 * @param locale
1636 * The locale to use.
1637 * @return The formatted bytes using the default pattern.
1639 @NonNull
1640 public static String formatAsMetricUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1641 @NonNull final Locale locale) {
1642 return formatAsMetricUnit(numberOfBytes, asFormat(pattern, locale));
1646 * @param numberOfBytes
1647 * The amount of bytes to format.
1648 * @param format
1649 * The formatting pattern to apply.
1650 * @return The formatted bytes using the default pattern.
1652 @NonNull
1653 public static String formatAsMetricUnit(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1654 return formatAsMetricUnit(numberOfBytes.longValue(), format);
1658 * @param numberOfBytes
1659 * The amount of bytes to format.
1660 * @param format
1661 * The formatting pattern to apply.
1662 * @return The formatted bytes using the default pattern.
1664 @NonNull
1665 public static String formatAsMetricUnit(final long numberOfBytes, @NonNull final Format format) {
1666 return formatAsMetricUnit(asBigInteger(numberOfBytes), format);
1670 * @param numberOfBytes
1671 * The amount of bytes to format.
1672 * @param format
1673 * The formatting pattern to apply.
1674 * @return The formatted bytes using the default pattern.
1676 @NonNull
1677 public static String formatAsMetricUnit(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1678 return metricValueOf(numberOfBytes).toString(format);
1682 * @param numberOfBytes
1683 * The amount of bytes to format.
1684 * @return The formatted bytes using the default pattern.
1686 @NonNull
1687 public static String formatAsKilobyte(@NonNull final Long numberOfBytes) {
1688 return formatAsKilobyte(numberOfBytes.longValue());
1692 * @param numberOfBytes
1693 * The amount of bytes to format.
1694 * @return The formatted bytes using the default pattern.
1696 @NonNull
1697 public static String formatAsKilobyte(final long numberOfBytes) {
1698 return formatAsKilobyte(asBigInteger(numberOfBytes));
1702 * @param numberOfBytes
1703 * The amount of bytes to format.
1704 * @return The formatted bytes using the default pattern.
1706 @NonNull
1707 public static String formatAsKilobyte(@NonNull final BigInteger numberOfBytes) {
1708 return formatAsKilobyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1712 * @param numberOfBytes
1713 * The amount of bytes to format.
1714 * @param pattern
1715 * The formatting pattern to apply.
1716 * @return The formatted bytes using the default pattern.
1718 @NonNull
1719 public static String formatAsKilobyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1720 return formatAsKilobyte(numberOfBytes.longValue(), pattern);
1724 * @param numberOfBytes
1725 * The amount of bytes to format.
1726 * @param pattern
1727 * The formatting pattern to apply.
1728 * @return The formatted bytes using the default pattern.
1730 @NonNull
1731 public static String formatAsKilobyte(final long numberOfBytes, @NonNull final String pattern) {
1732 return formatAsKilobyte(asBigInteger(numberOfBytes), pattern);
1736 * @param numberOfBytes
1737 * The amount of bytes to format.
1738 * @param pattern
1739 * The formatting pattern to apply.
1740 * @return The formatted bytes using the default pattern.
1742 @NonNull
1743 public static String formatAsKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1744 return formatAsKilobyte(numberOfBytes, new DecimalFormat(pattern));
1748 * @param numberOfBytes
1749 * The amount of bytes to format.
1750 * @param pattern
1751 * The formatting pattern to apply.
1752 * @param locale
1753 * The locale to use.
1754 * @return The formatted bytes using the default pattern.
1756 @NonNull
1757 public static String formatAsKilobyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1758 @NonNull final Locale locale) {
1759 return formatAsKilobyte(numberOfBytes.longValue(), pattern, locale);
1763 * @param numberOfBytes
1764 * The amount of bytes to format.
1765 * @param pattern
1766 * The formatting pattern to apply.
1767 * @param locale
1768 * The locale to use.
1769 * @return The formatted bytes using the default pattern.
1771 @NonNull
1772 public static String formatAsKilobyte(final long numberOfBytes, @NonNull final String pattern,
1773 @NonNull final Locale locale) {
1774 return formatAsKilobyte(asBigInteger(numberOfBytes), pattern, locale);
1778 * @param numberOfBytes
1779 * The amount of bytes to format.
1780 * @param pattern
1781 * The formatting pattern to apply.
1782 * @param locale
1783 * The locale to use.
1784 * @return The formatted bytes using the default pattern.
1786 @NonNull
1787 public static String formatAsKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1788 @NonNull final Locale locale) {
1789 return formatAsKilobyte(numberOfBytes, asFormat(pattern, locale));
1793 * @param numberOfBytes
1794 * The amount of bytes to format.
1795 * @param format
1796 * The formatting pattern to apply.
1797 * @return The formatted bytes using the default pattern.
1799 @NonNull
1800 public static String formatAsKilobyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1801 return formatAsKilobyte(numberOfBytes.longValue(), format);
1805 * @param numberOfBytes
1806 * The amount of bytes to format.
1807 * @param format
1808 * The formatting pattern to apply.
1809 * @return The formatted bytes using the default pattern.
1811 @NonNull
1812 public static String formatAsKilobyte(final long numberOfBytes, @NonNull final Format format) {
1813 return formatAsKilobyte(asBigInteger(numberOfBytes), format);
1817 * @param numberOfBytes
1818 * The amount of bytes to format.
1819 * @param format
1820 * The formatting pattern to apply.
1821 * @return The formatted bytes using the default pattern.
1823 @NonNull
1824 public static String formatAsKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1825 return Kilobyte.valueOf(numberOfBytes).toString(format);
1829 * @param numberOfBytes
1830 * The amount of bytes to format.
1831 * @return The formatted bytes using the default pattern.
1833 @NonNull
1834 public static String formatAsMegabyte(@NonNull final Long numberOfBytes) {
1835 return formatAsMegabyte(numberOfBytes.longValue());
1839 * @param numberOfBytes
1840 * The amount of bytes to format.
1841 * @return The formatted bytes using the default pattern.
1843 @NonNull
1844 public static String formatAsMegabyte(final long numberOfBytes) {
1845 return formatAsMegabyte(asBigInteger(numberOfBytes));
1849 * @param numberOfBytes
1850 * The amount of bytes to format.
1851 * @return The formatted bytes using the default pattern.
1853 @NonNull
1854 public static String formatAsMegabyte(@NonNull final BigInteger numberOfBytes) {
1855 return formatAsMegabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1859 * @param numberOfBytes
1860 * The amount of bytes to format.
1861 * @param pattern
1862 * The formatting pattern to apply.
1863 * @return The formatted bytes using the default pattern.
1865 @NonNull
1866 public static String formatAsMegabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1867 return formatAsMegabyte(numberOfBytes.longValue(), pattern);
1871 * @param numberOfBytes
1872 * The amount of bytes to format.
1873 * @param pattern
1874 * The formatting pattern to apply.
1875 * @return The formatted bytes using the default pattern.
1877 @NonNull
1878 public static String formatAsMegabyte(final long numberOfBytes, @NonNull final String pattern) {
1879 return formatAsMegabyte(asBigInteger(numberOfBytes), pattern);
1883 * @param numberOfBytes
1884 * The amount of bytes to format.
1885 * @param pattern
1886 * The formatting pattern to apply.
1887 * @return The formatted bytes using the default pattern.
1889 @NonNull
1890 public static String formatAsMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1891 return formatAsMegabyte(numberOfBytes, new DecimalFormat(pattern));
1895 * @param numberOfBytes
1896 * The amount of bytes to format.
1897 * @param pattern
1898 * The formatting pattern to apply.
1899 * @param locale
1900 * The locale to use.
1901 * @return The formatted bytes using the default pattern.
1903 @NonNull
1904 public static String formatAsMegabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1905 @NonNull final Locale locale) {
1906 return formatAsMegabyte(numberOfBytes.longValue(), pattern, locale);
1910 * @param numberOfBytes
1911 * The amount of bytes to format.
1912 * @param pattern
1913 * The formatting pattern to apply.
1914 * @param locale
1915 * The locale to use.
1916 * @return The formatted bytes using the default pattern.
1918 @NonNull
1919 public static String formatAsMegabyte(final long numberOfBytes, @NonNull final String pattern,
1920 @NonNull final Locale locale) {
1921 return formatAsMegabyte(asBigInteger(numberOfBytes), pattern, locale);
1925 * @param numberOfBytes
1926 * The amount of bytes to format.
1927 * @param pattern
1928 * The formatting pattern to apply.
1929 * @param locale
1930 * The locale to use.
1931 * @return The formatted bytes using the default pattern.
1933 @NonNull
1934 public static String formatAsMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1935 @NonNull final Locale locale) {
1936 return formatAsMegabyte(numberOfBytes, asFormat(pattern, locale));
1940 * @param numberOfBytes
1941 * The amount of bytes to format.
1942 * @param format
1943 * The formatting pattern to apply.
1944 * @return The formatted bytes using the default pattern.
1946 @NonNull
1947 public static String formatAsMegabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1948 return formatAsMegabyte(numberOfBytes.longValue(), format);
1952 * @param numberOfBytes
1953 * The amount of bytes to format.
1954 * @param format
1955 * The formatting pattern to apply.
1956 * @return The formatted bytes using the default pattern.
1958 @NonNull
1959 public static String formatAsMegabyte(final long numberOfBytes, @NonNull final Format format) {
1960 return formatAsMegabyte(asBigInteger(numberOfBytes), format);
1964 * @param numberOfBytes
1965 * The amount of bytes to format.
1966 * @param format
1967 * The formatting pattern to apply.
1968 * @return The formatted bytes using the default pattern.
1970 @NonNull
1971 public static String formatAsMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1972 return Megabyte.valueOf(numberOfBytes).toString(format);
1976 * @param numberOfBytes
1977 * The amount of bytes to format.
1978 * @return The formatted bytes using the default pattern.
1980 @NonNull
1981 public static String formatAsGigabyte(@NonNull final Long numberOfBytes) {
1982 return formatAsGigabyte(numberOfBytes.longValue());
1986 * @param numberOfBytes
1987 * The amount of bytes to format.
1988 * @return The formatted bytes using the default pattern.
1990 @NonNull
1991 public static String formatAsGigabyte(final long numberOfBytes) {
1992 return formatAsGigabyte(asBigInteger(numberOfBytes));
1996 * @param numberOfBytes
1997 * The amount of bytes to format.
1998 * @return The formatted bytes using the default pattern.
2000 @NonNull
2001 public static String formatAsGigabyte(@NonNull final BigInteger numberOfBytes) {
2002 return formatAsGigabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2006 * @param numberOfBytes
2007 * The amount of bytes to format.
2008 * @param pattern
2009 * The formatting pattern to apply.
2010 * @return The formatted bytes using the default pattern.
2012 @NonNull
2013 public static String formatAsGigabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2014 return formatAsGigabyte(numberOfBytes.longValue(), pattern);
2018 * @param numberOfBytes
2019 * The amount of bytes to format.
2020 * @param pattern
2021 * The formatting pattern to apply.
2022 * @return The formatted bytes using the default pattern.
2024 @NonNull
2025 public static String formatAsGigabyte(final long numberOfBytes, @NonNull final String pattern) {
2026 return formatAsGigabyte(asBigInteger(numberOfBytes), pattern);
2030 * @param numberOfBytes
2031 * The amount of bytes to format.
2032 * @param pattern
2033 * The formatting pattern to apply.
2034 * @return The formatted bytes using the default pattern.
2036 @NonNull
2037 public static String formatAsGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2038 return formatAsGigabyte(numberOfBytes, new DecimalFormat(pattern));
2042 * @param numberOfBytes
2043 * The amount of bytes to format.
2044 * @param pattern
2045 * The formatting pattern to apply.
2046 * @param locale
2047 * The locale to use.
2048 * @return The formatted bytes using the default pattern.
2050 @NonNull
2051 public static String formatAsGigabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2052 @NonNull final Locale locale) {
2053 return formatAsGigabyte(numberOfBytes.longValue(), pattern, locale);
2057 * @param numberOfBytes
2058 * The amount of bytes to format.
2059 * @param pattern
2060 * The formatting pattern to apply.
2061 * @param locale
2062 * The locale to use.
2063 * @return The formatted bytes using the default pattern.
2065 @NonNull
2066 public static String formatAsGigabyte(final long numberOfBytes, @NonNull final String pattern,
2067 @NonNull final Locale locale) {
2068 return formatAsGigabyte(asBigInteger(numberOfBytes), pattern, locale);
2072 * @param numberOfBytes
2073 * The amount of bytes to format.
2074 * @param pattern
2075 * The formatting pattern to apply.
2076 * @param locale
2077 * The locale to use.
2078 * @return The formatted bytes using the default pattern.
2080 @NonNull
2081 public static String formatAsGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2082 @NonNull final Locale locale) {
2083 return formatAsGigabyte(numberOfBytes, asFormat(pattern, locale));
2087 * @param numberOfBytes
2088 * The amount of bytes to format.
2089 * @param format
2090 * The formatting pattern to apply.
2091 * @return The formatted bytes using the default pattern.
2093 @NonNull
2094 public static String formatAsGigabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2095 return formatAsGigabyte(numberOfBytes.longValue(), format);
2099 * @param numberOfBytes
2100 * The amount of bytes to format.
2101 * @param format
2102 * The formatting pattern to apply.
2103 * @return The formatted bytes using the default pattern.
2105 @NonNull
2106 public static String formatAsGigabyte(final long numberOfBytes, @NonNull final Format format) {
2107 return formatAsGigabyte(asBigInteger(numberOfBytes), format);
2111 * @param numberOfBytes
2112 * The amount of bytes to format.
2113 * @param format
2114 * The formatting pattern to apply.
2115 * @return The formatted bytes using the default pattern.
2117 @NonNull
2118 public static String formatAsGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2119 return Gigabyte.valueOf(numberOfBytes).toString(format);
2123 * @param numberOfBytes
2124 * The amount of bytes to format.
2125 * @return The formatted bytes using the default pattern.
2127 @NonNull
2128 public static String formatAsTerabyte(@NonNull final Long numberOfBytes) {
2129 return formatAsTerabyte(numberOfBytes.longValue());
2133 * @param numberOfBytes
2134 * The amount of bytes to format.
2135 * @return The formatted bytes using the default pattern.
2137 @NonNull
2138 public static String formatAsTerabyte(final long numberOfBytes) {
2139 return formatAsTerabyte(asBigInteger(numberOfBytes));
2143 * @param numberOfBytes
2144 * The amount of bytes to format.
2145 * @return The formatted bytes using the default pattern.
2147 @NonNull
2148 public static String formatAsTerabyte(@NonNull final BigInteger numberOfBytes) {
2149 return formatAsTerabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2153 * @param numberOfBytes
2154 * The amount of bytes to format.
2155 * @param pattern
2156 * The formatting pattern to apply.
2157 * @return The formatted bytes using the default pattern.
2159 @NonNull
2160 public static String formatAsTerabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2161 return formatAsTerabyte(numberOfBytes.longValue(), pattern);
2165 * @param numberOfBytes
2166 * The amount of bytes to format.
2167 * @param pattern
2168 * The formatting pattern to apply.
2169 * @return The formatted bytes using the default pattern.
2171 @NonNull
2172 public static String formatAsTerabyte(final long numberOfBytes, @NonNull final String pattern) {
2173 return formatAsTerabyte(asBigInteger(numberOfBytes), pattern);
2177 * @param numberOfBytes
2178 * The amount of bytes to format.
2179 * @param pattern
2180 * The formatting pattern to apply.
2181 * @return The formatted bytes using the default pattern.
2183 @NonNull
2184 public static String formatAsTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2185 return formatAsTerabyte(numberOfBytes, new DecimalFormat(pattern));
2189 * @param numberOfBytes
2190 * The amount of bytes to format.
2191 * @param pattern
2192 * The formatting pattern to apply.
2193 * @param locale
2194 * The locale to use.
2195 * @return The formatted bytes using the default pattern.
2197 @NonNull
2198 public static String formatAsTerabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2199 @NonNull final Locale locale) {
2200 return formatAsTerabyte(numberOfBytes.longValue(), pattern, locale);
2204 * @param numberOfBytes
2205 * The amount of bytes to format.
2206 * @param pattern
2207 * The formatting pattern to apply.
2208 * @param locale
2209 * The locale to use.
2210 * @return The formatted bytes using the default pattern.
2212 @NonNull
2213 public static String formatAsTerabyte(final long numberOfBytes, @NonNull final String pattern,
2214 @NonNull final Locale locale) {
2215 return formatAsTerabyte(asBigInteger(numberOfBytes), pattern, locale);
2219 * @param numberOfBytes
2220 * The amount of bytes to format.
2221 * @param pattern
2222 * The formatting pattern to apply.
2223 * @param locale
2224 * The locale to use.
2225 * @return The formatted bytes using the default pattern.
2227 @NonNull
2228 public static String formatAsTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2229 @NonNull final Locale locale) {
2230 return formatAsTerabyte(numberOfBytes, asFormat(pattern, locale));
2234 * @param numberOfBytes
2235 * The amount of bytes to format.
2236 * @param format
2237 * The formatting pattern to apply.
2238 * @return The formatted bytes using the default pattern.
2240 @NonNull
2241 public static String formatAsTerabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2242 return formatAsTerabyte(numberOfBytes.longValue(), format);
2246 * @param numberOfBytes
2247 * The amount of bytes to format.
2248 * @param format
2249 * The formatting pattern to apply.
2250 * @return The formatted bytes using the default pattern.
2252 @NonNull
2253 public static String formatAsTerabyte(final long numberOfBytes, @NonNull final Format format) {
2254 return formatAsTerabyte(asBigInteger(numberOfBytes), format);
2258 * @param numberOfBytes
2259 * The amount of bytes to format.
2260 * @param format
2261 * The formatting pattern to apply.
2262 * @return The formatted bytes using the default pattern.
2264 @NonNull
2265 public static String formatAsTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2266 return Terabyte.valueOf(numberOfBytes).toString(format);
2270 * @param numberOfBytes
2271 * The amount of bytes to format.
2272 * @return The formatted bytes using the default pattern.
2274 @NonNull
2275 public static String formatAsPetabyte(@NonNull final Long numberOfBytes) {
2276 return formatAsPetabyte(numberOfBytes.longValue());
2280 * @param numberOfBytes
2281 * The amount of bytes to format.
2282 * @return The formatted bytes using the default pattern.
2284 @NonNull
2285 public static String formatAsPetabyte(final long numberOfBytes) {
2286 return formatAsPetabyte(asBigInteger(numberOfBytes));
2290 * @param numberOfBytes
2291 * The amount of bytes to format.
2292 * @return The formatted bytes using the default pattern.
2294 @NonNull
2295 public static String formatAsPetabyte(@NonNull final BigInteger numberOfBytes) {
2296 return formatAsPetabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2300 * @param numberOfBytes
2301 * The amount of bytes to format.
2302 * @param pattern
2303 * The formatting pattern to apply.
2304 * @return The formatted bytes using the default pattern.
2306 @NonNull
2307 public static String formatAsPetabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2308 return formatAsPetabyte(numberOfBytes.longValue(), pattern);
2312 * @param numberOfBytes
2313 * The amount of bytes to format.
2314 * @param pattern
2315 * The formatting pattern to apply.
2316 * @return The formatted bytes using the default pattern.
2318 @NonNull
2319 public static String formatAsPetabyte(final long numberOfBytes, @NonNull final String pattern) {
2320 return formatAsPetabyte(asBigInteger(numberOfBytes), pattern);
2324 * @param numberOfBytes
2325 * The amount of bytes to format.
2326 * @param pattern
2327 * The formatting pattern to apply.
2328 * @return The formatted bytes using the default pattern.
2330 @NonNull
2331 public static String formatAsPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2332 return formatAsPetabyte(numberOfBytes, new DecimalFormat(pattern));
2336 * @param numberOfBytes
2337 * The amount of bytes to format.
2338 * @param pattern
2339 * The formatting pattern to apply.
2340 * @param locale
2341 * The locale to use.
2342 * @return The formatted bytes using the default pattern.
2344 @NonNull
2345 public static String formatAsPetabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2346 @NonNull final Locale locale) {
2347 return formatAsPetabyte(numberOfBytes.longValue(), pattern, locale);
2351 * @param numberOfBytes
2352 * The amount of bytes to format.
2353 * @param pattern
2354 * The formatting pattern to apply.
2355 * @param locale
2356 * The locale to use.
2357 * @return The formatted bytes using the default pattern.
2359 @NonNull
2360 public static String formatAsPetabyte(final long numberOfBytes, @NonNull final String pattern,
2361 @NonNull final Locale locale) {
2362 return formatAsPetabyte(asBigInteger(numberOfBytes), pattern, locale);
2366 * @param numberOfBytes
2367 * The amount of bytes to format.
2368 * @param pattern
2369 * The formatting pattern to apply.
2370 * @param locale
2371 * The locale to use.
2372 * @return The formatted bytes using the default pattern.
2374 @NonNull
2375 public static String formatAsPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2376 @NonNull final Locale locale) {
2377 return formatAsPetabyte(numberOfBytes, asFormat(pattern, locale));
2381 * @param numberOfBytes
2382 * The amount of bytes to format.
2383 * @param format
2384 * The formatting pattern to apply.
2385 * @return The formatted bytes using the default pattern.
2387 @NonNull
2388 public static String formatAsPetabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2389 return formatAsPetabyte(numberOfBytes.longValue(), format);
2393 * @param numberOfBytes
2394 * The amount of bytes to format.
2395 * @param format
2396 * The formatting pattern to apply.
2397 * @return The formatted bytes using the default pattern.
2399 @NonNull
2400 public static String formatAsPetabyte(final long numberOfBytes, @NonNull final Format format) {
2401 return formatAsPetabyte(asBigInteger(numberOfBytes), format);
2405 * @param numberOfBytes
2406 * The amount of bytes to format.
2407 * @param format
2408 * The formatting pattern to apply.
2409 * @return The formatted bytes using the default pattern.
2411 @NonNull
2412 public static String formatAsPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2413 return Petabyte.valueOf(numberOfBytes).toString(format);
2417 * @param numberOfBytes
2418 * The amount of bytes to format.
2419 * @return The formatted bytes using the default pattern.
2421 @NonNull
2422 public static String formatAsExabyte(@NonNull final Long numberOfBytes) {
2423 return formatAsExabyte(numberOfBytes.longValue());
2427 * @param numberOfBytes
2428 * The amount of bytes to format.
2429 * @return The formatted bytes using the default pattern.
2431 @NonNull
2432 public static String formatAsExabyte(final long numberOfBytes) {
2433 return formatAsExabyte(asBigInteger(numberOfBytes));
2437 * @param numberOfBytes
2438 * The amount of bytes to format.
2439 * @return The formatted bytes using the default pattern.
2441 @NonNull
2442 public static String formatAsExabyte(@NonNull final BigInteger numberOfBytes) {
2443 return formatAsExabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2447 * @param numberOfBytes
2448 * The amount of bytes to format.
2449 * @param pattern
2450 * The formatting pattern to apply.
2451 * @return The formatted bytes using the default pattern.
2453 @NonNull
2454 public static String formatAsExabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2455 return formatAsExabyte(numberOfBytes.longValue(), pattern);
2459 * @param numberOfBytes
2460 * The amount of bytes to format.
2461 * @param pattern
2462 * The formatting pattern to apply.
2463 * @return The formatted bytes using the default pattern.
2465 @NonNull
2466 public static String formatAsExabyte(final long numberOfBytes, @NonNull final String pattern) {
2467 return formatAsExabyte(asBigInteger(numberOfBytes), pattern);
2471 * @param numberOfBytes
2472 * The amount of bytes to format.
2473 * @param pattern
2474 * The formatting pattern to apply.
2475 * @return The formatted bytes using the default pattern.
2477 @NonNull
2478 public static String formatAsExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2479 return formatAsExabyte(numberOfBytes, new DecimalFormat(pattern));
2483 * @param numberOfBytes
2484 * The amount of bytes to format.
2485 * @param pattern
2486 * The formatting pattern to apply.
2487 * @param locale
2488 * The locale to use.
2489 * @return The formatted bytes using the default pattern.
2491 @NonNull
2492 public static String formatAsExabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2493 @NonNull final Locale locale) {
2494 return formatAsExabyte(numberOfBytes.longValue(), pattern, locale);
2498 * @param numberOfBytes
2499 * The amount of bytes to format.
2500 * @param pattern
2501 * The formatting pattern to apply.
2502 * @param locale
2503 * The locale to use.
2504 * @return The formatted bytes using the default pattern.
2506 @NonNull
2507 public static String formatAsExabyte(final long numberOfBytes, @NonNull final String pattern,
2508 @NonNull final Locale locale) {
2509 return formatAsExabyte(asBigInteger(numberOfBytes), pattern, locale);
2513 * @param numberOfBytes
2514 * The amount of bytes to format.
2515 * @param pattern
2516 * The formatting pattern to apply.
2517 * @param locale
2518 * The locale to use.
2519 * @return The formatted bytes using the default pattern.
2521 @NonNull
2522 public static String formatAsExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2523 @NonNull final Locale locale) {
2524 return formatAsExabyte(numberOfBytes, asFormat(pattern, locale));
2528 * @param numberOfBytes
2529 * The amount of bytes to format.
2530 * @param format
2531 * The formatting pattern to apply.
2532 * @return The formatted bytes using the default pattern.
2534 @NonNull
2535 public static String formatAsExabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2536 return formatAsExabyte(numberOfBytes.longValue(), format);
2540 * @param numberOfBytes
2541 * The amount of bytes to format.
2542 * @param format
2543 * The formatting pattern to apply.
2544 * @return The formatted bytes using the default pattern.
2546 @NonNull
2547 public static String formatAsExabyte(final long numberOfBytes, @NonNull final Format format) {
2548 return formatAsExabyte(asBigInteger(numberOfBytes), format);
2552 * @param numberOfBytes
2553 * The amount of bytes to format.
2554 * @param format
2555 * The formatting pattern to apply.
2556 * @return The formatted bytes using the default pattern.
2558 @NonNull
2559 public static String formatAsExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2560 return Exabyte.valueOf(numberOfBytes).toString(format);
2564 * @param numberOfBytes
2565 * The amount of bytes to format.
2566 * @return The formatted bytes using the default pattern.
2568 @NonNull
2569 public static String formatAsZettabyte(@NonNull final Long numberOfBytes) {
2570 return formatAsZettabyte(numberOfBytes.longValue());
2574 * @param numberOfBytes
2575 * The amount of bytes to format.
2576 * @return The formatted bytes using the default pattern.
2578 @NonNull
2579 public static String formatAsZettabyte(final long numberOfBytes) {
2580 return formatAsZettabyte(asBigInteger(numberOfBytes));
2584 * @param numberOfBytes
2585 * The amount of bytes to format.
2586 * @return The formatted bytes using the default pattern.
2588 @NonNull
2589 public static String formatAsZettabyte(@NonNull final BigInteger numberOfBytes) {
2590 return formatAsZettabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2594 * @param numberOfBytes
2595 * The amount of bytes to format.
2596 * @param pattern
2597 * The formatting pattern to apply.
2598 * @return The formatted bytes using the default pattern.
2600 @NonNull
2601 public static String formatAsZettabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2602 return formatAsZettabyte(numberOfBytes.longValue(), pattern);
2606 * @param numberOfBytes
2607 * The amount of bytes to format.
2608 * @param pattern
2609 * The formatting pattern to apply.
2610 * @return The formatted bytes using the default pattern.
2612 @NonNull
2613 public static String formatAsZettabyte(final long numberOfBytes, @NonNull final String pattern) {
2614 return formatAsZettabyte(asBigInteger(numberOfBytes), pattern);
2618 * @param numberOfBytes
2619 * The amount of bytes to format.
2620 * @param pattern
2621 * The formatting pattern to apply.
2622 * @return The formatted bytes using the default pattern.
2624 @NonNull
2625 public static String formatAsZettabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2626 return formatAsZettabyte(numberOfBytes, new DecimalFormat(pattern));
2630 * @param numberOfBytes
2631 * The amount of bytes to format.
2632 * @param pattern
2633 * The formatting pattern to apply.
2634 * @param locale
2635 * The locale to use.
2636 * @return The formatted bytes using the default pattern.
2638 @NonNull
2639 public static String formatAsZettabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2640 @NonNull final Locale locale) {
2641 return formatAsZettabyte(numberOfBytes.longValue(), pattern, locale);
2645 * @param numberOfBytes
2646 * The amount of bytes to format.
2647 * @param pattern
2648 * The formatting pattern to apply.
2649 * @param locale
2650 * The locale to use.
2651 * @return The formatted bytes using the default pattern.
2653 @NonNull
2654 public static String formatAsZettabyte(final long numberOfBytes, @NonNull final String pattern,
2655 @NonNull final Locale locale) {
2656 return formatAsZettabyte(asBigInteger(numberOfBytes), pattern, locale);
2660 * @param numberOfBytes
2661 * The amount of bytes to format.
2662 * @param pattern
2663 * The formatting pattern to apply.
2664 * @param locale
2665 * The locale to use.
2666 * @return The formatted bytes using the default pattern.
2668 @NonNull
2669 public static String formatAsZettabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2670 @NonNull final Locale locale) {
2671 return formatAsZettabyte(numberOfBytes, asFormat(pattern, locale));
2675 * @param numberOfBytes
2676 * The amount of bytes to format.
2677 * @param format
2678 * The formatting pattern to apply.
2679 * @return The formatted bytes using the default pattern.
2681 @NonNull
2682 public static String formatAsZettabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2683 return formatAsZettabyte(numberOfBytes.longValue(), format);
2687 * @param numberOfBytes
2688 * The amount of bytes to format.
2689 * @param format
2690 * The formatting pattern to apply.
2691 * @return The formatted bytes using the default pattern.
2693 @NonNull
2694 public static String formatAsZettabyte(final long numberOfBytes, @NonNull final Format format) {
2695 return formatAsZettabyte(asBigInteger(numberOfBytes), format);
2699 * @param numberOfBytes
2700 * The amount of bytes to format.
2701 * @param format
2702 * The formatting pattern to apply.
2703 * @return The formatted bytes using the default pattern.
2705 @NonNull
2706 public static String formatAsZettabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2707 return Zettabyte.valueOf(numberOfBytes).toString(format);
2711 * @param numberOfBytes
2712 * The amount of bytes to format.
2713 * @return The formatted bytes using the default pattern.
2715 @NonNull
2716 public static String formatAsYottabyte(@NonNull final Long numberOfBytes) {
2717 return formatAsYottabyte(numberOfBytes.longValue());
2721 * @param numberOfBytes
2722 * The amount of bytes to format.
2723 * @return The formatted bytes using the default pattern.
2725 @NonNull
2726 public static String formatAsYottabyte(final long numberOfBytes) {
2727 return formatAsYottabyte(asBigInteger(numberOfBytes));
2731 * @param numberOfBytes
2732 * The amount of bytes to format.
2733 * @return The formatted bytes using the default pattern.
2735 @NonNull
2736 public static String formatAsYottabyte(@NonNull final BigInteger numberOfBytes) {
2737 return formatAsYottabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2741 * @param numberOfBytes
2742 * The amount of bytes to format.
2743 * @param pattern
2744 * The formatting pattern to apply.
2745 * @return The formatted bytes using the default pattern.
2747 @NonNull
2748 public static String formatAsYottabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2749 return formatAsYottabyte(numberOfBytes.longValue(), pattern);
2753 * @param numberOfBytes
2754 * The amount of bytes to format.
2755 * @param pattern
2756 * The formatting pattern to apply.
2757 * @return The formatted bytes using the default pattern.
2759 @NonNull
2760 public static String formatAsYottabyte(final long numberOfBytes, @NonNull final String pattern) {
2761 return formatAsYottabyte(asBigInteger(numberOfBytes), pattern);
2765 * @param numberOfBytes
2766 * The amount of bytes to format.
2767 * @param pattern
2768 * The formatting pattern to apply.
2769 * @param locale
2770 * The locale to use.
2771 * @return The formatted bytes using the default pattern.
2773 @NonNull
2774 public static String formatAsYottabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2775 @NonNull final Locale locale) {
2776 return formatAsYottabyte(numberOfBytes, asFormat(pattern, locale));
2780 * @param numberOfBytes
2781 * The amount of bytes to format.
2782 * @param pattern
2783 * The formatting pattern to apply.
2784 * @param locale
2785 * The locale to use.
2786 * @return The formatted bytes using the default pattern.
2788 @NonNull
2789 public static String formatAsYottabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2790 @NonNull final Locale locale) {
2791 return formatAsYottabyte(numberOfBytes.longValue(), pattern, locale);
2795 * @param numberOfBytes
2796 * The amount of bytes to format.
2797 * @param pattern
2798 * The formatting pattern to apply.
2799 * @param locale
2800 * The locale to use.
2801 * @return The formatted bytes using the default pattern.
2803 @NonNull
2804 public static String formatAsYottabyte(final long numberOfBytes, @NonNull final String pattern,
2805 @NonNull final Locale locale) {
2806 return formatAsYottabyte(asBigInteger(numberOfBytes), pattern, locale);
2810 * @param numberOfBytes
2811 * The amount of bytes to format.
2812 * @param pattern
2813 * The formatting pattern to apply.
2814 * @return The formatted bytes using the default pattern.
2816 @NonNull
2817 public static String formatAsYottabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2818 return formatAsYottabyte(numberOfBytes, new DecimalFormat(pattern));
2822 * @param numberOfBytes
2823 * The amount of bytes to format.
2824 * @param format
2825 * The formatting pattern to apply.
2826 * @return The formatted bytes using the default pattern.
2828 @NonNull
2829 public static String formatAsYottabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2830 return formatAsYottabyte(numberOfBytes.longValue(), format);
2834 * @param numberOfBytes
2835 * The amount of bytes to format.
2836 * @param format
2837 * The formatting pattern to apply.
2838 * @return The formatted bytes using the default pattern.
2840 @NonNull
2841 public static String formatAsYottabyte(final long numberOfBytes, @NonNull final Format format) {
2842 return formatAsYottabyte(asBigInteger(numberOfBytes), format);
2846 * @param numberOfBytes
2847 * The amount of bytes to format.
2848 * @param format
2849 * The formatting pattern to apply.
2850 * @return The formatted bytes using the default pattern.
2852 @NonNull
2853 public static String formatAsYottabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2854 return Yottabyte.valueOf(numberOfBytes).toString(format);
2858 * @param numberOfBytes
2859 * The amount of bytes to format.
2860 * @return The formatted bytes using the default pattern.
2862 @NonNull
2863 public static String formatAsCommonUnit(@NonNull final Long numberOfBytes) {
2864 return formatAsCommonUnit(numberOfBytes.longValue());
2868 * @param numberOfBytes
2869 * The amount of bytes to format.
2870 * @return The formatted bytes using the default pattern.
2872 @NonNull
2873 public static String formatAsCommonUnit(final long numberOfBytes) {
2874 return formatAsCommonUnit(asBigInteger(numberOfBytes));
2878 * @param numberOfBytes
2879 * The amount of bytes to format.
2880 * @return The formatted bytes using the default pattern.
2882 @NonNull
2883 public static String formatAsCommonUnit(@NonNull final BigInteger numberOfBytes) {
2884 return formatAsCommonUnit(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2888 * @param numberOfBytes
2889 * The amount of bytes to format.
2890 * @param pattern
2891 * The formatting pattern to apply.
2892 * @return The formatted bytes using the default pattern.
2894 @NonNull
2895 public static String formatAsCommonUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2896 return formatAsCommonUnit(numberOfBytes.longValue(), pattern);
2900 * @param numberOfBytes
2901 * The amount of bytes to format.
2902 * @param pattern
2903 * The formatting pattern to apply.
2904 * @return The formatted bytes using the default pattern.
2906 @NonNull
2907 public static String formatAsCommonUnit(final long numberOfBytes, @NonNull final String pattern) {
2908 return formatAsCommonUnit(asBigInteger(numberOfBytes), pattern);
2912 * @param numberOfBytes
2913 * The amount of bytes to format.
2914 * @param pattern
2915 * The formatting pattern to apply.
2916 * @return The formatted bytes using the default pattern.
2918 @NonNull
2919 public static String formatAsCommonUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2920 return formatAsCommonUnit(numberOfBytes, new DecimalFormat(pattern));
2924 * @param numberOfBytes
2925 * The amount of bytes to format.
2926 * @param pattern
2927 * The formatting pattern to apply.
2928 * @param locale
2929 * The locale to use.
2930 * @return The formatted bytes using the default pattern.
2932 @NonNull
2933 public static String formatAsCommonUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2934 @NonNull final Locale locale) {
2935 return formatAsCommonUnit(numberOfBytes.longValue(), pattern, locale);
2939 * @param numberOfBytes
2940 * The amount of bytes to format.
2941 * @param pattern
2942 * The formatting pattern to apply.
2943 * @param locale
2944 * The locale to use.
2945 * @return The formatted bytes using the default pattern.
2947 @NonNull
2948 public static String formatAsCommonUnit(final long numberOfBytes, @NonNull final String pattern,
2949 @NonNull final Locale locale) {
2950 return formatAsCommonUnit(asBigInteger(numberOfBytes), pattern, locale);
2954 * @param numberOfBytes
2955 * The amount of bytes to format.
2956 * @param pattern
2957 * The formatting pattern to apply.
2958 * @param locale
2959 * The locale to use.
2960 * @return The formatted bytes using the default pattern.
2962 @NonNull
2963 public static String formatAsCommonUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2964 @NonNull final Locale locale) {
2965 return formatAsCommonUnit(numberOfBytes, asFormat(pattern, locale));
2969 * @param numberOfBytes
2970 * The amount of bytes to format.
2971 * @param format
2972 * The formatting pattern to apply.
2973 * @return The formatted bytes using the default pattern.
2975 @NonNull
2976 public static String formatAsCommonUnit(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2977 return formatAsCommonUnit(numberOfBytes.longValue(), format);
2981 * @param numberOfBytes
2982 * The amount of bytes to format.
2983 * @param format
2984 * The formatting pattern to apply.
2985 * @return The formatted bytes using the default pattern.
2987 @NonNull
2988 public static String formatAsCommonUnit(final long numberOfBytes, @NonNull final Format format) {
2989 return formatAsCommonUnit(asBigInteger(numberOfBytes), format);
2993 * @param numberOfBytes
2994 * The amount of bytes to format.
2995 * @param format
2996 * The formatting pattern to apply.
2997 * @return The formatted bytes using the default pattern.
2999 @NonNull
3000 public static String formatAsCommonUnit(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3001 return commonValueOf(numberOfBytes).toString(format);
3005 * @param numberOfBytes
3006 * The amount of bytes to format.
3007 * @return The formatted bytes using the default pattern.
3009 @NonNull
3010 public static String formatAsCommonKilobyte(@NonNull final Long numberOfBytes) {
3011 return formatAsCommonKilobyte(numberOfBytes.longValue());
3015 * @param numberOfBytes
3016 * The amount of bytes to format.
3017 * @return The formatted bytes using the default pattern.
3019 @NonNull
3020 public static String formatAsCommonKilobyte(final long numberOfBytes) {
3021 return formatAsCommonKilobyte(asBigInteger(numberOfBytes));
3025 * @param numberOfBytes
3026 * The amount of bytes to format.
3027 * @return The formatted bytes using the default pattern.
3029 @NonNull
3030 public static String formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes) {
3031 return formatAsCommonKilobyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3035 * @param numberOfBytes
3036 * The amount of bytes to format.
3037 * @param pattern
3038 * The formatting pattern to apply.
3039 * @return The formatted bytes using the default pattern.
3041 @NonNull
3042 public static String formatAsCommonKilobyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3043 return formatAsCommonKilobyte(numberOfBytes.longValue(), pattern);
3047 * @param numberOfBytes
3048 * The amount of bytes to format.
3049 * @param pattern
3050 * The formatting pattern to apply.
3051 * @return The formatted bytes using the default pattern.
3053 @NonNull
3054 public static String formatAsCommonKilobyte(final long numberOfBytes, @NonNull final String pattern) {
3055 return formatAsCommonKilobyte(asBigInteger(numberOfBytes), pattern);
3059 * @param numberOfBytes
3060 * The amount of bytes to format.
3061 * @param pattern
3062 * The formatting pattern to apply.
3063 * @return The formatted bytes using the default pattern.
3065 @NonNull
3066 public static String formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes,
3067 @NonNull final String pattern) {
3068 return formatAsCommonKilobyte(numberOfBytes, new DecimalFormat(pattern));
3072 * @param numberOfBytes
3073 * The amount of bytes to format.
3074 * @param pattern
3075 * The formatting pattern to apply.
3076 * @param locale
3077 * The locale to use.
3078 * @return The formatted bytes using the default pattern.
3080 @NonNull
3081 public static String formatAsCommonKilobyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3082 @NonNull final Locale locale) {
3083 return formatAsCommonKilobyte(numberOfBytes.longValue(), pattern, locale);
3087 * @param numberOfBytes
3088 * The amount of bytes to format.
3089 * @param pattern
3090 * The formatting pattern to apply.
3091 * @param locale
3092 * The locale to use.
3093 * @return The formatted bytes using the default pattern.
3095 @NonNull
3096 public static String formatAsCommonKilobyte(final long numberOfBytes, @NonNull final String pattern,
3097 @NonNull final Locale locale) {
3098 return formatAsCommonKilobyte(asBigInteger(numberOfBytes), pattern, locale);
3102 * @param numberOfBytes
3103 * The amount of bytes to format.
3104 * @param pattern
3105 * The formatting pattern to apply.
3106 * @param locale
3107 * The locale to use.
3108 * @return The formatted bytes using the default pattern.
3110 @NonNull
3111 public static String formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3112 @NonNull final Locale locale) {
3113 return formatAsCommonKilobyte(numberOfBytes, asFormat(pattern, locale));
3117 * @param numberOfBytes
3118 * The amount of bytes to format.
3119 * @param format
3120 * The formatting pattern to apply.
3121 * @return The formatted bytes using the default pattern.
3123 @NonNull
3124 public static String formatAsCommonKilobyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3125 return formatAsCommonKilobyte(numberOfBytes.longValue(), format);
3129 * @param numberOfBytes
3130 * The amount of bytes to format.
3131 * @param format
3132 * The formatting pattern to apply.
3133 * @return The formatted bytes using the default pattern.
3135 @NonNull
3136 public static String formatAsCommonKilobyte(final long numberOfBytes, @NonNull final Format format) {
3137 return formatAsCommonKilobyte(asBigInteger(numberOfBytes), format);
3141 * @param numberOfBytes
3142 * The amount of bytes to format.
3143 * @param format
3144 * The formatting pattern to apply.
3145 * @return The formatted bytes using the default pattern.
3147 @NonNull
3148 public static String formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3149 return CommonKilobyte.valueOf(numberOfBytes).toString(format);
3153 * @param numberOfBytes
3154 * The amount of bytes to format.
3155 * @return The formatted bytes using the default pattern.
3157 @NonNull
3158 public static String formatAsCommonMegabyte(@NonNull final Long numberOfBytes) {
3159 return formatAsCommonMegabyte(numberOfBytes.longValue());
3163 * @param numberOfBytes
3164 * The amount of bytes to format.
3165 * @return The formatted bytes using the default pattern.
3167 @NonNull
3168 public static String formatAsCommonMegabyte(final long numberOfBytes) {
3169 return formatAsCommonMegabyte(asBigInteger(numberOfBytes));
3173 * @param numberOfBytes
3174 * The amount of bytes to format.
3175 * @return The formatted bytes using the default pattern.
3177 @NonNull
3178 public static String formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes) {
3179 return formatAsCommonMegabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3183 * @param numberOfBytes
3184 * The amount of bytes to format.
3185 * @param pattern
3186 * The formatting pattern to apply.
3187 * @return The formatted bytes using the default pattern.
3189 @NonNull
3190 public static String formatAsCommonMegabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3191 return formatAsCommonMegabyte(numberOfBytes.longValue(), pattern);
3195 * @param numberOfBytes
3196 * The amount of bytes to format.
3197 * @param pattern
3198 * The formatting pattern to apply.
3199 * @return The formatted bytes using the default pattern.
3201 @NonNull
3202 public static String formatAsCommonMegabyte(final long numberOfBytes, @NonNull final String pattern) {
3203 return formatAsCommonMegabyte(asBigInteger(numberOfBytes), pattern);
3207 * @param numberOfBytes
3208 * The amount of bytes to format.
3209 * @param pattern
3210 * The formatting pattern to apply.
3211 * @return The formatted bytes using the default pattern.
3213 @NonNull
3214 public static String formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes,
3215 @NonNull final String pattern) {
3216 return formatAsCommonMegabyte(numberOfBytes, new DecimalFormat(pattern));
3220 * @param numberOfBytes
3221 * The amount of bytes to format.
3222 * @param pattern
3223 * The formatting pattern to apply.
3224 * @param locale
3225 * The locale to use.
3226 * @return The formatted bytes using the default pattern.
3228 @NonNull
3229 public static String formatAsCommonMegabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3230 @NonNull final Locale locale) {
3231 return formatAsCommonMegabyte(numberOfBytes.longValue(), pattern, locale);
3235 * @param numberOfBytes
3236 * The amount of bytes to format.
3237 * @param pattern
3238 * The formatting pattern to apply.
3239 * @param locale
3240 * The locale to use.
3241 * @return The formatted bytes using the default pattern.
3243 @NonNull
3244 public static String formatAsCommonMegabyte(final long numberOfBytes, @NonNull final String pattern,
3245 @NonNull final Locale locale) {
3246 return formatAsCommonMegabyte(asBigInteger(numberOfBytes), pattern, locale);
3250 * @param numberOfBytes
3251 * The amount of bytes to format.
3252 * @param pattern
3253 * The formatting pattern to apply.
3254 * @param locale
3255 * The locale to use.
3256 * @return The formatted bytes using the default pattern.
3258 @NonNull
3259 public static String formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3260 @NonNull final Locale locale) {
3261 return formatAsCommonMegabyte(numberOfBytes, asFormat(pattern, locale));
3265 * @param numberOfBytes
3266 * The amount of bytes to format.
3267 * @param format
3268 * The formatting pattern to apply.
3269 * @return The formatted bytes using the default pattern.
3271 @NonNull
3272 public static String formatAsCommonMegabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3273 return formatAsCommonMegabyte(numberOfBytes.longValue(), format);
3277 * @param numberOfBytes
3278 * The amount of bytes to format.
3279 * @param format
3280 * The formatting pattern to apply.
3281 * @return The formatted bytes using the default pattern.
3283 @NonNull
3284 public static String formatAsCommonMegabyte(final long numberOfBytes, @NonNull final Format format) {
3285 return formatAsCommonMegabyte(asBigInteger(numberOfBytes), format);
3289 * @param numberOfBytes
3290 * The amount of bytes to format.
3291 * @param format
3292 * The formatting pattern to apply.
3293 * @return The formatted bytes using the default pattern.
3295 @NonNull
3296 public static String formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3297 return CommonMegabyte.valueOf(numberOfBytes).toString(format);
3301 * @param numberOfBytes
3302 * The amount of bytes to format.
3303 * @return The formatted bytes using the default pattern.
3305 @NonNull
3306 public static String formatAsCommonGigabyte(@NonNull final Long numberOfBytes) {
3307 return formatAsCommonGigabyte(numberOfBytes.longValue());
3311 * @param numberOfBytes
3312 * The amount of bytes to format.
3313 * @return The formatted bytes using the default pattern.
3315 @NonNull
3316 public static String formatAsCommonGigabyte(final long numberOfBytes) {
3317 return formatAsCommonGigabyte(asBigInteger(numberOfBytes));
3321 * @param numberOfBytes
3322 * The amount of bytes to format.
3323 * @return The formatted bytes using the default pattern.
3325 @NonNull
3326 public static String formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes) {
3327 return formatAsCommonGigabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3331 * @param numberOfBytes
3332 * The amount of bytes to format.
3333 * @param pattern
3334 * The formatting pattern to apply.
3335 * @return The formatted bytes using the default pattern.
3337 @NonNull
3338 public static String formatAsCommonGigabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3339 return formatAsCommonGigabyte(numberOfBytes.longValue(), pattern);
3343 * @param numberOfBytes
3344 * The amount of bytes to format.
3345 * @param pattern
3346 * The formatting pattern to apply.
3347 * @return The formatted bytes using the default pattern.
3349 @NonNull
3350 public static String formatAsCommonGigabyte(final long numberOfBytes, @NonNull final String pattern) {
3351 return formatAsCommonGigabyte(asBigInteger(numberOfBytes), pattern);
3355 * @param numberOfBytes
3356 * The amount of bytes to format.
3357 * @param pattern
3358 * The formatting pattern to apply.
3359 * @return The formatted bytes using the default pattern.
3361 @NonNull
3362 public static String formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes,
3363 @NonNull final String pattern) {
3364 return formatAsCommonGigabyte(numberOfBytes, new DecimalFormat(pattern));
3368 * @param numberOfBytes
3369 * The amount of bytes to format.
3370 * @param pattern
3371 * The formatting pattern to apply.
3372 * @param locale
3373 * The locale to use.
3374 * @return The formatted bytes using the default pattern.
3376 @NonNull
3377 public static String formatAsCommonGigabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3378 @NonNull final Locale locale) {
3379 return formatAsCommonGigabyte(numberOfBytes.longValue(), pattern, locale);
3383 * @param numberOfBytes
3384 * The amount of bytes to format.
3385 * @param pattern
3386 * The formatting pattern to apply.
3387 * @param locale
3388 * The locale to use.
3389 * @return The formatted bytes using the default pattern.
3391 @NonNull
3392 public static String formatAsCommonGigabyte(final long numberOfBytes, @NonNull final String pattern,
3393 @NonNull final Locale locale) {
3394 return formatAsCommonGigabyte(asBigInteger(numberOfBytes), pattern, locale);
3398 * @param numberOfBytes
3399 * The amount of bytes to format.
3400 * @param pattern
3401 * The formatting pattern to apply.
3402 * @param locale
3403 * The locale to use.
3404 * @return The formatted bytes using the default pattern.
3406 @NonNull
3407 public static String formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3408 @NonNull final Locale locale) {
3409 return formatAsCommonGigabyte(numberOfBytes, asFormat(pattern, locale));
3413 * @param numberOfBytes
3414 * The amount of bytes to format.
3415 * @param format
3416 * The formatting pattern to apply.
3417 * @return The formatted bytes using the default pattern.
3419 @NonNull
3420 public static String formatAsCommonGigabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3421 return formatAsCommonGigabyte(numberOfBytes.longValue(), format);
3425 * @param numberOfBytes
3426 * The amount of bytes to format.
3427 * @param format
3428 * The formatting pattern to apply.
3429 * @return The formatted bytes using the default pattern.
3431 @NonNull
3432 public static String formatAsCommonGigabyte(final long numberOfBytes, @NonNull final Format format) {
3433 return formatAsCommonGigabyte(asBigInteger(numberOfBytes), format);
3437 * @param numberOfBytes
3438 * The amount of bytes to format.
3439 * @param format
3440 * The formatting pattern to apply.
3441 * @return The formatted bytes using the default pattern.
3443 @NonNull
3444 public static String formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3445 return CommonGigabyte.valueOf(numberOfBytes).toString(format);
3449 * @param numberOfBytes
3450 * The amount of bytes to format.
3451 * @return The formatted bytes using the default pattern.
3453 @NonNull
3454 public static String formatAsCommonTerabyte(@NonNull final Long numberOfBytes) {
3455 return formatAsCommonTerabyte(numberOfBytes.longValue());
3459 * @param numberOfBytes
3460 * The amount of bytes to format.
3461 * @return The formatted bytes using the default pattern.
3463 @NonNull
3464 public static String formatAsCommonTerabyte(final long numberOfBytes) {
3465 return formatAsCommonTerabyte(asBigInteger(numberOfBytes));
3469 * @param numberOfBytes
3470 * The amount of bytes to format.
3471 * @return The formatted bytes using the default pattern.
3473 @NonNull
3474 public static String formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes) {
3475 return formatAsCommonTerabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3479 * @param numberOfBytes
3480 * The amount of bytes to format.
3481 * @param pattern
3482 * The formatting pattern to apply.
3483 * @return The formatted bytes using the default pattern.
3485 @NonNull
3486 public static String formatAsCommonTerabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3487 return formatAsCommonTerabyte(numberOfBytes.longValue(), pattern);
3491 * @param numberOfBytes
3492 * The amount of bytes to format.
3493 * @param pattern
3494 * The formatting pattern to apply.
3495 * @return The formatted bytes using the default pattern.
3497 @NonNull
3498 public static String formatAsCommonTerabyte(final long numberOfBytes, @NonNull final String pattern) {
3499 return formatAsCommonTerabyte(asBigInteger(numberOfBytes), pattern);
3503 * @param numberOfBytes
3504 * The amount of bytes to format.
3505 * @param pattern
3506 * The formatting pattern to apply.
3507 * @return The formatted bytes using the default pattern.
3509 @NonNull
3510 public static String formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes,
3511 @NonNull final String pattern) {
3512 return formatAsCommonTerabyte(numberOfBytes, new DecimalFormat(pattern));
3516 * @param numberOfBytes
3517 * The amount of bytes to format.
3518 * @param pattern
3519 * The formatting pattern to apply.
3520 * @param locale
3521 * The locale to use.
3522 * @return The formatted bytes using the default pattern.
3524 @NonNull
3525 public static String formatAsCommonTerabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3526 @NonNull final Locale locale) {
3527 return formatAsCommonTerabyte(numberOfBytes.longValue(), pattern, locale);
3531 * @param numberOfBytes
3532 * The amount of bytes to format.
3533 * @param pattern
3534 * The formatting pattern to apply.
3535 * @param locale
3536 * The locale to use.
3537 * @return The formatted bytes using the default pattern.
3539 @NonNull
3540 public static String formatAsCommonTerabyte(final long numberOfBytes, @NonNull final String pattern,
3541 @NonNull final Locale locale) {
3542 return formatAsCommonTerabyte(asBigInteger(numberOfBytes), pattern, locale);
3546 * @param numberOfBytes
3547 * The amount of bytes to format.
3548 * @param pattern
3549 * The formatting pattern to apply.
3550 * @param locale
3551 * The locale to use.
3552 * @return The formatted bytes using the default pattern.
3554 @NonNull
3555 public static String formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3556 @NonNull final Locale locale) {
3557 return formatAsCommonTerabyte(numberOfBytes, asFormat(pattern, locale));
3561 * @param numberOfBytes
3562 * The amount of bytes to format.
3563 * @param format
3564 * The formatting pattern to apply.
3565 * @return The formatted bytes using the default pattern.
3567 @NonNull
3568 public static String formatAsCommonTerabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3569 return formatAsCommonTerabyte(numberOfBytes.longValue(), format);
3573 * @param numberOfBytes
3574 * The amount of bytes to format.
3575 * @param format
3576 * The formatting pattern to apply.
3577 * @return The formatted bytes using the default pattern.
3579 @NonNull
3580 public static String formatAsCommonTerabyte(final long numberOfBytes, @NonNull final Format format) {
3581 return formatAsCommonTerabyte(asBigInteger(numberOfBytes), format);
3585 * @param numberOfBytes
3586 * The amount of bytes to format.
3587 * @param format
3588 * The formatting pattern to apply.
3589 * @return The formatted bytes using the default pattern.
3591 @NonNull
3592 public static String formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3593 return CommonTerabyte.valueOf(numberOfBytes).toString(format);
3597 * @param numberOfBytes
3598 * The amount of bytes to format.
3599 * @return The formatted bytes using the default pattern.
3601 @NonNull
3602 public static String formatAsCommonPetabyte(@NonNull final Long numberOfBytes) {
3603 return formatAsCommonPetabyte(numberOfBytes.longValue());
3607 * @param numberOfBytes
3608 * The amount of bytes to format.
3609 * @return The formatted bytes using the default pattern.
3611 @NonNull
3612 public static String formatAsCommonPetabyte(final long numberOfBytes) {
3613 return formatAsCommonPetabyte(asBigInteger(numberOfBytes));
3617 * @param numberOfBytes
3618 * The amount of bytes to format.
3619 * @return The formatted bytes using the default pattern.
3621 @NonNull
3622 public static String formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes) {
3623 return formatAsCommonPetabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3627 * @param numberOfBytes
3628 * The amount of bytes to format.
3629 * @param pattern
3630 * The formatting pattern to apply.
3631 * @return The formatted bytes using the default pattern.
3633 @NonNull
3634 public static String formatAsCommonPetabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3635 return formatAsCommonPetabyte(numberOfBytes.longValue(), pattern);
3639 * @param numberOfBytes
3640 * The amount of bytes to format.
3641 * @param pattern
3642 * The formatting pattern to apply.
3643 * @return The formatted bytes using the default pattern.
3645 @NonNull
3646 public static String formatAsCommonPetabyte(final long numberOfBytes, @NonNull final String pattern) {
3647 return formatAsCommonPetabyte(asBigInteger(numberOfBytes), pattern);
3651 * @param numberOfBytes
3652 * The amount of bytes to format.
3653 * @param pattern
3654 * The formatting pattern to apply.
3655 * @return The formatted bytes using the default pattern.
3657 @NonNull
3658 public static String formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes,
3659 @NonNull final String pattern) {
3660 return formatAsCommonPetabyte(numberOfBytes, new DecimalFormat(pattern));
3664 * @param numberOfBytes
3665 * The amount of bytes to format.
3666 * @param pattern
3667 * The formatting pattern to apply.
3668 * @param locale
3669 * The locale to use.
3670 * @return The formatted bytes using the default pattern.
3672 @NonNull
3673 public static String formatAsCommonPetabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3674 @NonNull final Locale locale) {
3675 return formatAsCommonPetabyte(numberOfBytes.longValue(), pattern, locale);
3679 * @param numberOfBytes
3680 * The amount of bytes to format.
3681 * @param pattern
3682 * The formatting pattern to apply.
3683 * @param locale
3684 * The locale to use.
3685 * @return The formatted bytes using the default pattern.
3687 @NonNull
3688 public static String formatAsCommonPetabyte(final long numberOfBytes, @NonNull final String pattern,
3689 @NonNull final Locale locale) {
3690 return formatAsCommonPetabyte(asBigInteger(numberOfBytes), pattern, locale);
3694 * @param numberOfBytes
3695 * The amount of bytes to format.
3696 * @param pattern
3697 * The formatting pattern to apply.
3698 * @param locale
3699 * The locale to use.
3700 * @return The formatted bytes using the default pattern.
3702 @NonNull
3703 public static String formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3704 @NonNull final Locale locale) {
3705 return formatAsCommonPetabyte(numberOfBytes, asFormat(pattern, locale));
3709 * @param numberOfBytes
3710 * The amount of bytes to format.
3711 * @param format
3712 * The formatting pattern to apply.
3713 * @return The formatted bytes using the default pattern.
3715 @NonNull
3716 public static String formatAsCommonPetabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3717 return formatAsCommonPetabyte(numberOfBytes.longValue(), format);
3721 * @param numberOfBytes
3722 * The amount of bytes to format.
3723 * @param format
3724 * The formatting pattern to apply.
3725 * @return The formatted bytes using the default pattern.
3727 @NonNull
3728 public static String formatAsCommonPetabyte(final long numberOfBytes, @NonNull final Format format) {
3729 return formatAsCommonPetabyte(asBigInteger(numberOfBytes), format);
3733 * @param numberOfBytes
3734 * The amount of bytes to format.
3735 * @param format
3736 * The formatting pattern to apply.
3737 * @return The formatted bytes using the default pattern.
3739 @NonNull
3740 public static String formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3741 return CommonPetabyte.valueOf(numberOfBytes).toString(format);
3745 * @param numberOfBytes
3746 * The amount of bytes to format.
3747 * @return The formatted bytes using the default pattern.
3749 @NonNull
3750 public static String formatAsCommonExabyte(@NonNull final Long numberOfBytes) {
3751 return formatAsCommonExabyte(numberOfBytes.longValue());
3755 * @param numberOfBytes
3756 * The amount of bytes to format.
3757 * @return The formatted bytes using the default pattern.
3759 @NonNull
3760 public static String formatAsCommonExabyte(final long numberOfBytes) {
3761 return formatAsCommonExabyte(asBigInteger(numberOfBytes));
3765 * @param numberOfBytes
3766 * The amount of bytes to format.
3767 * @return The formatted bytes using the default pattern.
3769 @NonNull
3770 public static String formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes) {
3771 return formatAsCommonExabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3775 * @param numberOfBytes
3776 * The amount of bytes to format.
3777 * @param pattern
3778 * The formatting pattern to apply.
3779 * @return The formatted bytes using the default pattern.
3781 @NonNull
3782 public static String formatAsCommonExabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3783 return formatAsCommonExabyte(numberOfBytes.longValue(), pattern);
3787 * @param numberOfBytes
3788 * The amount of bytes to format.
3789 * @param pattern
3790 * The formatting pattern to apply.
3791 * @return The formatted bytes using the default pattern.
3793 @NonNull
3794 public static String formatAsCommonExabyte(final long numberOfBytes, @NonNull final String pattern) {
3795 return formatAsCommonExabyte(asBigInteger(numberOfBytes), pattern);
3799 * @param numberOfBytes
3800 * The amount of bytes to format.
3801 * @param pattern
3802 * The formatting pattern to apply.
3803 * @return The formatted bytes using the default pattern.
3805 @NonNull
3806 public static String formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
3807 return formatAsCommonExabyte(numberOfBytes, new DecimalFormat(pattern));
3811 * @param numberOfBytes
3812 * The amount of bytes to format.
3813 * @param pattern
3814 * The formatting pattern to apply.
3815 * @param locale
3816 * The locale to use.
3817 * @return The formatted bytes using the default pattern.
3819 @NonNull
3820 public static String formatAsCommonExabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3821 @NonNull final Locale locale) {
3822 return formatAsCommonExabyte(numberOfBytes.longValue(), pattern, locale);
3826 * @param numberOfBytes
3827 * The amount of bytes to format.
3828 * @param pattern
3829 * The formatting pattern to apply.
3830 * @param locale
3831 * The locale to use.
3832 * @return The formatted bytes using the default pattern.
3834 @NonNull
3835 public static String formatAsCommonExabyte(final long numberOfBytes, @NonNull final String pattern,
3836 @NonNull final Locale locale) {
3837 return formatAsCommonExabyte(asBigInteger(numberOfBytes), pattern, locale);
3841 * @param numberOfBytes
3842 * The amount of bytes to format.
3843 * @param pattern
3844 * The formatting pattern to apply.
3845 * @param locale
3846 * The locale to use.
3847 * @return The formatted bytes using the default pattern.
3849 @NonNull
3850 public static String formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3851 @NonNull final Locale locale) {
3852 return formatAsCommonExabyte(numberOfBytes, asFormat(pattern, locale));
3856 * @param numberOfBytes
3857 * The amount of bytes to format.
3858 * @param format
3859 * The formatting pattern to apply.
3860 * @return The formatted bytes using the default pattern.
3862 @NonNull
3863 public static String formatAsCommonExabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3864 return formatAsCommonExabyte(numberOfBytes.longValue(), format);
3868 * @param numberOfBytes
3869 * The amount of bytes to format.
3870 * @param format
3871 * The formatting pattern to apply.
3872 * @return The formatted bytes using the default pattern.
3874 @NonNull
3875 public static String formatAsCommonExabyte(final long numberOfBytes, @NonNull final Format format) {
3876 return formatAsCommonExabyte(asBigInteger(numberOfBytes), format);
3880 * @param numberOfBytes
3881 * The amount of bytes to format.
3882 * @param format
3883 * The formatting pattern to apply.
3884 * @return The formatted bytes using the default pattern.
3886 @NonNull
3887 public static String formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3888 return CommonExabyte.valueOf(numberOfBytes).toString(format);
3892 * @param numberOfBytes
3893 * The amount of bytes to format.
3894 * @return The formatted bytes using the default pattern.
3896 @NonNull
3897 public static String formatAsCommonZettabyte(@NonNull final Long numberOfBytes) {
3898 return formatAsCommonZettabyte(numberOfBytes.longValue());
3902 * @param numberOfBytes
3903 * The amount of bytes to format.
3904 * @return The formatted bytes using the default pattern.
3906 @NonNull
3907 public static String formatAsCommonZettabyte(final long numberOfBytes) {
3908 return formatAsCommonZettabyte(asBigInteger(numberOfBytes));
3912 * @param numberOfBytes
3913 * The amount of bytes to format.
3914 * @return The formatted bytes using the default pattern.
3916 @NonNull
3917 public static String formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes) {
3918 return formatAsCommonZettabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3922 * @param numberOfBytes
3923 * The amount of bytes to format.
3924 * @param pattern
3925 * The formatting pattern to apply.
3926 * @return The formatted bytes using the default pattern.
3928 @NonNull
3929 public static String formatAsCommonZettabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3930 return formatAsCommonZettabyte(numberOfBytes.longValue(), pattern);
3934 * @param numberOfBytes
3935 * The amount of bytes to format.
3936 * @param pattern
3937 * The formatting pattern to apply.
3938 * @return The formatted bytes using the default pattern.
3940 @NonNull
3941 public static String formatAsCommonZettabyte(final long numberOfBytes, @NonNull final String pattern) {
3942 return formatAsCommonZettabyte(asBigInteger(numberOfBytes), pattern);
3946 * @param numberOfBytes
3947 * The amount of bytes to format.
3948 * @param pattern
3949 * The formatting pattern to apply.
3950 * @return The formatted bytes using the default pattern.
3952 @NonNull
3953 public static String formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes,
3954 @NonNull final String pattern) {
3955 return formatAsCommonZettabyte(numberOfBytes, new DecimalFormat(pattern));
3959 * @param numberOfBytes
3960 * The amount of bytes to format.
3961 * @param pattern
3962 * The formatting pattern to apply.
3963 * @param locale
3964 * The locale to use.
3965 * @return The formatted bytes using the default pattern.
3967 @NonNull
3968 public static String formatAsCommonZettabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3969 @NonNull final Locale locale) {
3970 return formatAsCommonZettabyte(numberOfBytes.longValue(), pattern, locale);
3974 * @param numberOfBytes
3975 * The amount of bytes to format.
3976 * @param pattern
3977 * The formatting pattern to apply.
3978 * @param locale
3979 * The locale to use.
3980 * @return The formatted bytes using the default pattern.
3982 @NonNull
3983 public static String formatAsCommonZettabyte(final long numberOfBytes, @NonNull final String pattern,
3984 @NonNull final Locale locale) {
3985 return formatAsCommonZettabyte(asBigInteger(numberOfBytes), pattern, locale);
3989 * @param numberOfBytes
3990 * The amount of bytes to format.
3991 * @param pattern
3992 * The formatting pattern to apply.
3993 * @param locale
3994 * The locale to use.
3995 * @return The formatted bytes using the default pattern.
3997 @NonNull
3998 public static String formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3999 @NonNull final Locale locale) {
4000 return formatAsCommonZettabyte(numberOfBytes, asFormat(pattern, locale));
4004 * @param numberOfBytes
4005 * The amount of bytes to format.
4006 * @param format
4007 * The formatting pattern to apply.
4008 * @return The formatted bytes using the default pattern.
4010 @NonNull
4011 public static String formatAsCommonZettabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
4012 return formatAsCommonZettabyte(numberOfBytes.longValue(), format);
4016 * @param numberOfBytes
4017 * The amount of bytes to format.
4018 * @param format
4019 * The formatting pattern to apply.
4020 * @return The formatted bytes using the default pattern.
4022 @NonNull
4023 public static String formatAsCommonZettabyte(final long numberOfBytes, @NonNull final Format format) {
4024 return formatAsCommonZettabyte(asBigInteger(numberOfBytes), format);
4028 * @param numberOfBytes
4029 * The amount of bytes to format.
4030 * @param format
4031 * The formatting pattern to apply.
4032 * @return The formatted bytes using the default pattern.
4034 @NonNull
4035 public static String formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes,
4036 @NonNull final Format format) {
4037 return CommonZettabyte.valueOf(numberOfBytes).toString(format);
4041 * @param numberOfBytes
4042 * The amount of bytes to format.
4043 * @return The formatted bytes using the default pattern.
4045 @NonNull
4046 public static String formatAsCommonYottabyte(@NonNull final Long numberOfBytes) {
4047 return formatAsCommonYottabyte(numberOfBytes.longValue());
4051 * @param numberOfBytes
4052 * The amount of bytes to format.
4053 * @return The formatted bytes using the default pattern.
4055 @NonNull
4056 public static String formatAsCommonYottabyte(final long numberOfBytes) {
4057 return formatAsCommonYottabyte(asBigInteger(numberOfBytes));
4061 * @param numberOfBytes
4062 * The amount of bytes to format.
4063 * @return The formatted bytes using the default pattern.
4065 @NonNull
4066 public static String formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes) {
4067 return formatAsCommonYottabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
4071 * @param numberOfBytes
4072 * The amount of bytes to format.
4073 * @param pattern
4074 * The formatting pattern to apply.
4075 * @return The formatted bytes using the default pattern.
4077 @NonNull
4078 public static String formatAsCommonYottabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
4079 return formatAsCommonYottabyte(numberOfBytes.longValue(), pattern);
4083 * @param numberOfBytes
4084 * The amount of bytes to format.
4085 * @param pattern
4086 * The formatting pattern to apply.
4087 * @return The formatted bytes using the default pattern.
4089 @NonNull
4090 public static String formatAsCommonYottabyte(final long numberOfBytes, @NonNull final String pattern) {
4091 return formatAsCommonYottabyte(asBigInteger(numberOfBytes), pattern);
4095 * @param numberOfBytes
4096 * The amount of bytes to format.
4097 * @param pattern
4098 * The formatting pattern to apply.
4099 * @param locale
4100 * The locale to use.
4101 * @return The formatted bytes using the default pattern.
4103 @NonNull
4104 public static String formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
4105 @NonNull final Locale locale) {
4106 return formatAsCommonYottabyte(numberOfBytes, asFormat(pattern, locale));
4110 * @param numberOfBytes
4111 * The amount of bytes to format.
4112 * @param pattern
4113 * The formatting pattern to apply.
4114 * @param locale
4115 * The locale to use.
4116 * @return The formatted bytes using the default pattern.
4118 @NonNull
4119 public static String formatAsCommonYottabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
4120 @NonNull final Locale locale) {
4121 return formatAsCommonYottabyte(numberOfBytes.longValue(), pattern, locale);
4125 * @param numberOfBytes
4126 * The amount of bytes to format.
4127 * @param pattern
4128 * The formatting pattern to apply.
4129 * @param locale
4130 * The locale to use.
4131 * @return The formatted bytes using the default pattern.
4133 @NonNull
4134 public static String formatAsCommonYottabyte(final long numberOfBytes, @NonNull final String pattern,
4135 @NonNull final Locale locale) {
4136 return formatAsCommonYottabyte(asBigInteger(numberOfBytes), pattern, locale);
4140 * @param numberOfBytes
4141 * The amount of bytes to format.
4142 * @param pattern
4143 * The formatting pattern to apply.
4144 * @return The formatted bytes using the default pattern.
4146 @NonNull
4147 public static String formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes,
4148 @NonNull final String pattern) {
4149 return formatAsCommonYottabyte(numberOfBytes, new DecimalFormat(pattern));
4153 * @param numberOfBytes
4154 * The amount of bytes to format.
4155 * @param format
4156 * The formatting pattern to apply.
4157 * @return The formatted bytes using the default pattern.
4159 @NonNull
4160 public static String formatAsCommonYottabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
4161 return formatAsCommonYottabyte(numberOfBytes.longValue(), format);
4165 * @param numberOfBytes
4166 * The amount of bytes to format.
4167 * @param format
4168 * The formatting pattern to apply.
4169 * @return The formatted bytes using the default pattern.
4171 @NonNull
4172 public static String formatAsCommonYottabyte(final long numberOfBytes, @NonNull final Format format) {
4173 return formatAsCommonYottabyte(asBigInteger(numberOfBytes), format);
4177 * @param numberOfBytes
4178 * The amount of bytes to format.
4179 * @param format
4180 * The formatting pattern to apply.
4181 * @return The formatted bytes using the default pattern.
4183 @NonNull
4184 public static String formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes,
4185 @NonNull final Format format) {
4186 return CommonYottabyte.valueOf(numberOfBytes).toString(format);
4190 * @param numberOfBytes
4191 * The amount of bytes to create.
4192 * @return A new unit representing the given amount of bytes.
4194 @NonNull
4195 public static Byte bytes(@NonNull final Long numberOfBytes) {
4196 return bytes(numberOfBytes.longValue());
4200 * @param numberOfBytes
4201 * The amount of bytes to create.
4202 * @return A new unit representing the given amount of bytes.
4204 @NonNull
4205 public static Byte bytes(final long numberOfBytes) {
4206 return bytes(asBigInteger(numberOfBytes));
4210 * @param numberOfBytes
4211 * The amount of bytes to create.
4212 * @return A new unit representing the given amount of bytes.
4214 @NonNull
4215 public static Byte bytes(@NonNull final BigInteger numberOfBytes) {
4216 return new Byte(numberOfBytes);
4220 * @param numberOfKibibytes
4221 * The amount of kibibytes to create.
4222 * @return A new unit representing the given amount of kibibytes.
4224 @NonNull
4225 public static Kibibyte kibibyte(@NonNull final Long numberOfKibibytes) {
4226 return kibibyte(numberOfKibibytes.longValue());
4230 * @param numberOfKibibytes
4231 * The amount of kibibytes to create.
4232 * @return A new unit representing the given amount of kibibytes.
4234 @NonNull
4235 public static Kibibyte kibibyte(final long numberOfKibibytes) {
4236 return kibibyte(asBigInteger(numberOfKibibytes));
4240 * @param numberOfKibibytes
4241 * The amount of kibibytes to create.
4242 * @return A new unit representing the given amount of kibibytes.
4244 @NonNull
4245 public static Kibibyte kibibyte(@NonNull final BigInteger numberOfKibibytes) {
4246 return new Kibibyte(multiplyNullsafe(BYTES_IN_A_KIBIBYTE, numberOfKibibytes));
4250 * @param numberOfMebibytes
4251 * The amount of mebibytes to create.
4252 * @return A new unit representing the given amount of mebibytes.
4254 @NonNull
4255 public static Mebibyte mebibyte(@NonNull final Long numberOfMebibytes) {
4256 return mebibyte(numberOfMebibytes.longValue());
4260 * @param numberOfMebibytes
4261 * The amount of mebibytes to create.
4262 * @return A new unit representing the given amount of mebibytes.
4264 @NonNull
4265 public static Mebibyte mebibyte(final long numberOfMebibytes) {
4266 return mebibyte(asBigInteger(numberOfMebibytes));
4270 * @param numberOfMebibytes
4271 * The amount of mebibytes to create.
4272 * @return A new unit representing the given amount of mebibytes.
4274 @NonNull
4275 public static Mebibyte mebibyte(@NonNull final BigInteger numberOfMebibytes) {
4276 return new Mebibyte(multiplyNullsafe(BYTES_IN_A_MEBIBYTE, numberOfMebibytes));
4280 * @param numberOfGibibytes
4281 * The amount of gibibytes to create.
4282 * @return A new unit representing the given amount of gibibytes.
4284 @NonNull
4285 public static Gibibyte gibibyte(@NonNull final Long numberOfGibibytes) {
4286 return gibibyte(numberOfGibibytes.longValue());
4290 * @param numberOfGibibytes
4291 * The amount of gibibytes to create.
4292 * @return A new unit representing the given amount of gibibytes.
4294 @NonNull
4295 public static Gibibyte gibibyte(final long numberOfGibibytes) {
4296 return gibibyte(asBigInteger(numberOfGibibytes));
4300 * @param numberOfGibibytes
4301 * The amount of gibibytes to create.
4302 * @return A new unit representing the given amount of gibibytes.
4304 @NonNull
4305 public static Gibibyte gibibyte(@NonNull final BigInteger numberOfGibibytes) {
4306 return new Gibibyte(multiplyNullsafe(BYTES_IN_A_GIBIBYTE, numberOfGibibytes));
4310 * @param numberOfTebibytes
4311 * The amount of tebibytes to create.
4312 * @return A new unit representing the given amount of tebibytes.
4314 @NonNull
4315 public static Tebibyte tebibyte(@NonNull final Long numberOfTebibytes) {
4316 return tebibyte(numberOfTebibytes.longValue());
4320 * @param numberOfTebibytes
4321 * The amount of tebibytes to create.
4322 * @return A new unit representing the given amount of tebibytes.
4324 @NonNull
4325 public static Tebibyte tebibyte(final long numberOfTebibytes) {
4326 return tebibyte(asBigInteger(numberOfTebibytes));
4330 * @param numberOfTebibytes
4331 * The amount of tebibytes to create.
4332 * @return A new unit representing the given amount of tebibytes.
4334 @NonNull
4335 public static Tebibyte tebibyte(@NonNull final BigInteger numberOfTebibytes) {
4336 return new Tebibyte(multiplyNullsafe(BYTES_IN_A_TEBIBYTE, numberOfTebibytes));
4340 * @param numberOfPebibytes
4341 * The amount of pebibytes to create.
4342 * @return A new unit representing the given amount of pebibytes.
4344 @NonNull
4345 public static Pebibyte pebibyte(@NonNull final Long numberOfPebibytes) {
4346 return pebibyte(numberOfPebibytes.longValue());
4350 * @param numberOfPebibytes
4351 * The amount of pebibytes to create.
4352 * @return A new unit representing the given amount of pebibytes.
4354 @NonNull
4355 public static Pebibyte pebibyte(final long numberOfPebibytes) {
4356 return pebibyte(asBigInteger(numberOfPebibytes));
4360 * @param numberOfPebibytes
4361 * The amount of pebibytes to create.
4362 * @return A new unit representing the given amount of pebibytes.
4364 @NonNull
4365 public static Pebibyte pebibyte(@NonNull final BigInteger numberOfPebibytes) {
4366 return new Pebibyte(multiplyNullsafe(BYTES_IN_A_PEBIBYTE, numberOfPebibytes));
4370 * @param numberOfExbibytes
4371 * The amount of exbibytes to create.
4372 * @return A new unit representing the given amount of exbibytes.
4374 @NonNull
4375 public static Exbibyte exbibyte(@NonNull final Long numberOfExbibytes) {
4376 return exbibyte(numberOfExbibytes.longValue());
4380 * @param numberOfExbibytes
4381 * The amount of exbibytes to create.
4382 * @return A new unit representing the given amount of exbibytes.
4384 @NonNull
4385 public static Exbibyte exbibyte(final long numberOfExbibytes) {
4386 return exbibyte(asBigInteger(numberOfExbibytes));
4390 * @param numberOfExbibytes
4391 * The amount of exbibytes to create.
4392 * @return A new unit representing the given amount of exbibytes.
4394 @NonNull
4395 public static Exbibyte exbibyte(@NonNull final BigInteger numberOfExbibytes) {
4396 return new Exbibyte(multiplyNullsafe(BYTES_IN_A_EXBIBYTE, numberOfExbibytes));
4400 * @param numberOfZebibytes
4401 * The amount of zebibytes to create.
4402 * @return A new unit representing the given amount of zebibytes.
4404 @NonNull
4405 public static Zebibyte zebibyte(@NonNull final Long numberOfZebibytes) {
4406 return zebibyte(numberOfZebibytes.longValue());
4410 * @param numberOfZebibytes
4411 * The amount of zebibytes to create.
4412 * @return A new unit representing the given amount of zebibytes.
4414 @NonNull
4415 public static Zebibyte zebibyte(final long numberOfZebibytes) {
4416 return zebibyte(asBigInteger(numberOfZebibytes));
4420 * @param numberOfZebibytes
4421 * The amount of zebibytes to create.
4422 * @return A new unit representing the given amount of zebibytes.
4424 @NonNull
4425 public static Zebibyte zebibyte(@NonNull final BigInteger numberOfZebibytes) {
4426 return new Zebibyte(multiplyNullsafe(BYTES_IN_A_ZEBIBYTE, numberOfZebibytes));
4430 * @param numberOfYobibytes
4431 * The amount of yobibytes to create.
4432 * @return A new unit representing the given amount of yobibytes.
4434 @NonNull
4435 public static Yobibyte yobibyte(@NonNull final Long numberOfYobibytes) {
4436 return yobibyte(numberOfYobibytes.longValue());
4440 * @param numberOfYobibytes
4441 * The amount of yobibytes to create.
4442 * @return A new unit representing the given amount of yobibytes.
4444 @NonNull
4445 public static Yobibyte yobibyte(final long numberOfYobibytes) {
4446 return yobibyte(asBigInteger(numberOfYobibytes));
4450 * @param numberOfYobibytes
4451 * The amount of yobibytes to create.
4452 * @return A new unit representing the given amount of yobibytes.
4454 @NonNull
4455 public static Yobibyte yobibyte(@NonNull final BigInteger numberOfYobibytes) {
4456 return new Yobibyte(multiplyNullsafe(BYTES_IN_A_YOBIBYTE, numberOfYobibytes));
4460 * @param numberOfKilobytes
4461 * The number of kilobytes to create.
4462 * @return A new unit representing the given amount of kilobytes.
4464 @NonNull
4465 public static Kilobyte kilobyte(@NonNull final Long numberOfKilobytes) {
4466 return kilobyte(numberOfKilobytes.longValue());
4470 * @param numberOfKilobytes
4471 * The number of kilobytes to create.
4472 * @return A new unit representing the given amount of kilobytes.
4474 @NonNull
4475 public static Kilobyte kilobyte(final long numberOfKilobytes) {
4476 return kilobyte(asBigInteger(numberOfKilobytes));
4480 * @param numberOfKilobytes
4481 * The number of kilobytes to create.
4482 * @return A new unit representing the given amount of kilobytes.
4484 @NonNull
4485 public static Kilobyte kilobyte(@NonNull final BigInteger numberOfKilobytes) {
4486 return new Kilobyte(multiplyNullsafe(BYTES_IN_A_KILOBYTE, numberOfKilobytes));
4490 * @param numberOfMegabytes
4491 * The number of megabytes to create.
4492 * @return A new unit representing the given amount of megabytes.
4494 @NonNull
4495 public static Megabyte megabyte(@NonNull final Long numberOfMegabytes) {
4496 return megabyte(numberOfMegabytes.longValue());
4500 * @param numberOfMegabytes
4501 * The number of megabytes to create.
4502 * @return A new unit representing the given amount of megabytes.
4504 @NonNull
4505 public static Megabyte megabyte(final long numberOfMegabytes) {
4506 return megabyte(asBigInteger(numberOfMegabytes));
4510 * @param numberOfMegabytes
4511 * The number of megabytes to create.
4512 * @return A new unit representing the given amount of megabytes.
4514 @NonNull
4515 public static Megabyte megabyte(@NonNull final BigInteger numberOfMegabytes) {
4516 return new Megabyte(multiplyNullsafe(BYTES_IN_A_MEGABYTE, numberOfMegabytes));
4520 * @param numberOfGigabytes
4521 * The number of gigabytes to create.
4522 * @return A new unit representing the given amount of gigabytes.
4524 @NonNull
4525 public static Gigabyte gigabyte(@NonNull final Long numberOfGigabytes) {
4526 return gigabyte(numberOfGigabytes.longValue());
4530 * @param numberOfGigabytes
4531 * The number of gigabytes to create.
4532 * @return A new unit representing the given amount of gigabytes.
4534 @NonNull
4535 public static Gigabyte gigabyte(final long numberOfGigabytes) {
4536 return gigabyte(asBigInteger(numberOfGigabytes));
4540 * @param numberOfGigabytes
4541 * The number of gigabytes to create.
4542 * @return A new unit representing the given amount of gigabytes.
4544 @NonNull
4545 public static Gigabyte gigabyte(@NonNull final BigInteger numberOfGigabytes) {
4546 return new Gigabyte(multiplyNullsafe(BYTES_IN_A_GIGABYTE, numberOfGigabytes));
4550 * @param numberOfTerabytes
4551 * The number of terabytes to create.
4552 * @return A new unit representing the given amount of terabytes.
4554 @NonNull
4555 public static Terabyte terabyte(@NonNull final Long numberOfTerabytes) {
4556 return terabyte(numberOfTerabytes.longValue());
4560 * @param numberOfTerabytes
4561 * The number of terabytes to create.
4562 * @return A new unit representing the given amount of terabytes.
4564 @NonNull
4565 public static Terabyte terabyte(final long numberOfTerabytes) {
4566 return terabyte(asBigInteger(numberOfTerabytes));
4570 * @param numberOfTerabytes
4571 * The number of terabytes to create.
4572 * @return A new unit representing the given amount of terabytes.
4574 @NonNull
4575 public static Terabyte terabyte(@NonNull final BigInteger numberOfTerabytes) {
4576 return new Terabyte(multiplyNullsafe(BYTES_IN_A_TERABYTE, numberOfTerabytes));
4580 * @param numberOfPetabytes
4581 * The number of petabytes to create.
4582 * @return A new unit representing the given amount of petabytes.
4584 @NonNull
4585 public static Petabyte petabyte(@NonNull final Long numberOfPetabytes) {
4586 return petabyte(numberOfPetabytes.longValue());
4590 * @param numberOfPetabytes
4591 * The number of petabytes to create.
4592 * @return A new unit representing the given amount of petabytes.
4594 @NonNull
4595 public static Petabyte petabyte(final long numberOfPetabytes) {
4596 return petabyte(asBigInteger(numberOfPetabytes));
4600 * @param numberOfPetabytes
4601 * The number of petabytes to create.
4602 * @return A new unit representing the given amount of petabytes.
4604 @NonNull
4605 public static Petabyte petabyte(@NonNull final BigInteger numberOfPetabytes) {
4606 return new Petabyte(multiplyNullsafe(BYTES_IN_A_PETABYTE, numberOfPetabytes));
4610 * @param numberOfExabytes
4611 * The number of exabytes to create.
4612 * @return A new unit representing the given amount of exabytes.
4614 @NonNull
4615 public static Exabyte exabyte(@NonNull final Long numberOfExabytes) {
4616 return exabyte(numberOfExabytes.longValue());
4620 * @param numberOfExabytes
4621 * The number of exabytes to create.
4622 * @return A new unit representing the given amount of exabytes.
4624 @NonNull
4625 public static Exabyte exabyte(final long numberOfExabytes) {
4626 return exabyte(asBigInteger(numberOfExabytes));
4630 * @param numberOfExabytes
4631 * The number of exabytes to create.
4632 * @return A new unit representing the given amount of exabytes.
4634 @NonNull
4635 public static Exabyte exabyte(@NonNull final BigInteger numberOfExabytes) {
4636 return new Exabyte(multiplyNullsafe(BYTES_IN_A_EXABYTE, numberOfExabytes));
4640 * @param numberOfZettabytes
4641 * The number of zettabytes to create.
4642 * @return A new unit representing the given amount of zettabytes.
4644 @NonNull
4645 public static Zettabyte zettabyte(@NonNull final Long numberOfZettabytes) {
4646 return zettabyte(numberOfZettabytes.longValue());
4650 * @param numberOfZettabytes
4651 * The number of zettabytes to create.
4652 * @return A new unit representing the given amount of zettabytes.
4654 @NonNull
4655 public static Zettabyte zettabyte(final long numberOfZettabytes) {
4656 return zettabyte(asBigInteger(numberOfZettabytes));
4660 * @param numberOfZettabytes
4661 * The number of zettabytes to create.
4662 * @return A new unit representing the given amount of zettabytes.
4664 @NonNull
4665 public static Zettabyte zettabyte(@NonNull final BigInteger numberOfZettabytes) {
4666 return new Zettabyte(multiplyNullsafe(BYTES_IN_A_ZETTABYTE, numberOfZettabytes));
4670 * @param numberOfYottabytes
4671 * The number of yottabytes to create.
4672 * @return A new unit representing the given amount of yottabytes.
4674 @NonNull
4675 public static Yottabyte yottabyte(@NonNull final Long numberOfYottabytes) {
4676 return yottabyte(numberOfYottabytes.longValue());
4680 * @param numberOfYottabytes
4681 * The number of yottabytes to create.
4682 * @return A new unit representing the given amount of yottabytes.
4684 @NonNull
4685 public static Yottabyte yottabyte(final long numberOfYottabytes) {
4686 return yottabyte(asBigInteger(numberOfYottabytes));
4690 * @param numberOfYottabytes
4691 * The number of yottabytes to create.
4692 * @return A new unit representing the given amount of yottabytes.
4694 @NonNull
4695 public static Yottabyte yottabyte(@NonNull final BigInteger numberOfYottabytes) {
4696 return new Yottabyte(multiplyNullsafe(BYTES_IN_A_YOTTABYTE, numberOfYottabytes));
4700 * @param numberOfKilobytes
4701 * The number of kilobytes to create.
4702 * @return A new unit representing the given amount of kilobytes.
4704 @NonNull
4705 public static CommonKilobyte commonKilobyte(@NonNull final Long numberOfKilobytes) {
4706 return commonKilobyte(numberOfKilobytes.longValue());
4710 * @param numberOfKilobytes
4711 * The number of kilobytes to create.
4712 * @return A new unit representing the given amount of kilobytes.
4714 @NonNull
4715 public static CommonKilobyte commonKilobyte(final long numberOfKilobytes) {
4716 return commonKilobyte(asBigInteger(numberOfKilobytes));
4720 * @param numberOfKilobytes
4721 * The number of kilobytes to create.
4722 * @return A new unit representing the given amount of kilobytes.
4724 @NonNull
4725 public static CommonKilobyte commonKilobyte(@NonNull final BigInteger numberOfKilobytes) {
4726 return new CommonKilobyte(multiplyNullsafe(BYTES_IN_A_KIBIBYTE, numberOfKilobytes));
4730 * @param numberOfMegabytes
4731 * The number of megabytes to create.
4732 * @return A new unit representing the given amount of megabytes.
4734 @NonNull
4735 public static CommonMegabyte commonMegabyte(@NonNull final Long numberOfMegabytes) {
4736 return commonMegabyte(numberOfMegabytes.longValue());
4740 * @param numberOfMegabytes
4741 * The number of megabytes to create.
4742 * @return A new unit representing the given amount of megabytes.
4744 @NonNull
4745 public static CommonMegabyte commonMegabyte(final long numberOfMegabytes) {
4746 return commonMegabyte(asBigInteger(numberOfMegabytes));
4750 * @param numberOfMegabytes
4751 * The number of megabytes to create.
4752 * @return A new unit representing the given amount of megabytes.
4754 @NonNull
4755 public static CommonMegabyte commonMegabyte(@NonNull final BigInteger numberOfMegabytes) {
4756 return new CommonMegabyte(multiplyNullsafe(BYTES_IN_A_MEBIBYTE, numberOfMegabytes));
4760 * @param numberOfGigabytes
4761 * The number of gigabytes to create.
4762 * @return A new unit representing the given amount of gigabytes.
4764 @NonNull
4765 public static CommonGigabyte commonGigabyte(@NonNull final Long numberOfGigabytes) {
4766 return commonGigabyte(numberOfGigabytes.longValue());
4770 * @param numberOfGigabytes
4771 * The number of gigabytes to create.
4772 * @return A new unit representing the given amount of gigabytes.
4774 @NonNull
4775 public static CommonGigabyte commonGigabyte(final long numberOfGigabytes) {
4776 return commonGigabyte(asBigInteger(numberOfGigabytes));
4780 * @param numberOfGigabytes
4781 * The number of gigabytes to create.
4782 * @return A new unit representing the given amount of gigabytes.
4784 @NonNull
4785 public static CommonGigabyte commonGigabyte(@NonNull final BigInteger numberOfGigabytes) {
4786 return new CommonGigabyte(multiplyNullsafe(BYTES_IN_A_GIBIBYTE, numberOfGigabytes));
4790 * @param numberOfTerabytes
4791 * The number of terabytes to create.
4792 * @return A new unit representing the given amount of terabytes.
4794 @NonNull
4795 public static CommonTerabyte commonTerabyte(@NonNull final Long numberOfTerabytes) {
4796 return commonTerabyte(numberOfTerabytes.longValue());
4800 * @param numberOfTerabytes
4801 * The number of terabytes to create.
4802 * @return A new unit representing the given amount of terabytes.
4804 @NonNull
4805 public static CommonTerabyte commonTerabyte(final long numberOfTerabytes) {
4806 return commonTerabyte(asBigInteger(numberOfTerabytes));
4810 * @param numberOfTerabytes
4811 * The number of terabytes to create.
4812 * @return A new unit representing the given amount of terabytes.
4814 @NonNull
4815 public static CommonTerabyte commonTerabyte(@NonNull final BigInteger numberOfTerabytes) {
4816 return new CommonTerabyte(multiplyNullsafe(BYTES_IN_A_TEBIBYTE, numberOfTerabytes));
4820 * @param numberOfPetabytes
4821 * The number of petabytes to create.
4822 * @return A new unit representing the given amount of petabytes.
4824 @NonNull
4825 public static CommonPetabyte commonPetabyte(@NonNull final Long numberOfPetabytes) {
4826 return commonPetabyte(numberOfPetabytes.longValue());
4830 * @param numberOfPetabytes
4831 * The number of petabytes to create.
4832 * @return A new unit representing the given amount of petabytes.
4834 @NonNull
4835 public static CommonPetabyte commonPetabyte(final long numberOfPetabytes) {
4836 return commonPetabyte(asBigInteger(numberOfPetabytes));
4840 * @param numberOfPetabytes
4841 * The number of petabytes to create.
4842 * @return A new unit representing the given amount of petabytes.
4844 @NonNull
4845 public static CommonPetabyte commonPetabyte(@NonNull final BigInteger numberOfPetabytes) {
4846 return new CommonPetabyte(multiplyNullsafe(BYTES_IN_A_PEBIBYTE, numberOfPetabytes));
4850 * @param numberOfExabytes
4851 * The number of exabytes to create.
4852 * @return A new unit representing the given amount of exabytes.
4854 @NonNull
4855 public static CommonExabyte commonExabyte(@NonNull final Long numberOfExabytes) {
4856 return commonExabyte(numberOfExabytes.longValue());
4860 * @param numberOfExabytes
4861 * The number of exabytes to create.
4862 * @return A new unit representing the given amount of exabytes.
4864 @NonNull
4865 public static CommonExabyte commonExabyte(final long numberOfExabytes) {
4866 return commonExabyte(asBigInteger(numberOfExabytes));
4870 * @param numberOfExabytes
4871 * The number of exabytes to create.
4872 * @return A new unit representing the given amount of exabytes.
4874 @NonNull
4875 public static CommonExabyte commonExabyte(@NonNull final BigInteger numberOfExabytes) {
4876 return new CommonExabyte(multiplyNullsafe(BYTES_IN_A_EXBIBYTE, numberOfExabytes));
4880 * @param numberOfZettabytes
4881 * The number of zettabytes to create.
4882 * @return A new unit representing the given amount of zettabytes.
4884 @NonNull
4885 public static CommonZettabyte commonZettabyte(@NonNull final Long numberOfZettabytes) {
4886 return commonZettabyte(numberOfZettabytes.longValue());
4890 * @param numberOfZettabytes
4891 * The number of zettabytes to create.
4892 * @return A new unit representing the given amount of zettabytes.
4894 @NonNull
4895 public static CommonZettabyte commonZettabyte(final long numberOfZettabytes) {
4896 return commonZettabyte(asBigInteger(numberOfZettabytes));
4900 * @param numberOfZettabytes
4901 * The number of zettabytes to create.
4902 * @return A new unit representing the given amount of zettabytes.
4904 @NonNull
4905 public static CommonZettabyte commonZettabyte(@NonNull final BigInteger numberOfZettabytes) {
4906 return new CommonZettabyte(multiplyNullsafe(BYTES_IN_A_ZEBIBYTE, numberOfZettabytes));
4910 * @param numberOfYottabytes
4911 * The number of yottabytes to create.
4912 * @return A new unit representing the given amount of yottabytes.
4914 @NonNull
4915 public static CommonYottabyte commonYottabyte(@NonNull final Long numberOfYottabytes) {
4916 return commonYottabyte(numberOfYottabytes.longValue());
4920 * @param numberOfYottabytes
4921 * The number of yottabytes to create.
4922 * @return A new unit representing the given amount of yottabytes.
4924 @NonNull
4925 public static CommonYottabyte commonYottabyte(final long numberOfYottabytes) {
4926 return commonYottabyte(asBigInteger(numberOfYottabytes));
4930 * @param numberOfYottabytes
4931 * The number of yottabytes to create.
4932 * @return A new unit representing the given amount of yottabytes.
4934 @NonNull
4935 public static CommonYottabyte commonYottabyte(@NonNull final BigInteger numberOfYottabytes) {
4936 return new CommonYottabyte(multiplyNullsafe(BYTES_IN_A_YOBIBYTE, numberOfYottabytes));