fix #22
[storage-units.git] / storage-units / src / main / java / de / xn__ho_hia / storage_unit / StorageUnits.java
blobba2bf9bc6de61d63f2b58e054d635d1e06e00370
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.storage_unit;
9 import static de.xn__ho_hia.quality.null_analysis.Nullsafe.asBigInteger;
10 import static de.xn__ho_hia.quality.null_analysis.Nullsafe.multiplyNullsafe;
11 import static de.xn__ho_hia.quality.null_analysis.Nullsafe.nonNull;
12 import static de.xn__ho_hia.storage_unit.FormatUtils.asFormat;
13 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_EXABYTE;
14 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_EXBIBYTE;
15 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_GIBIBYTE;
16 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_GIGABYTE;
17 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_KIBIBYTE;
18 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_KILOBYTE;
19 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_MEBIBYTE;
20 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_MEGABYTE;
21 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_PEBIBYTE;
22 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_PETABYTE;
23 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_TEBIBYTE;
24 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_TERABYTE;
25 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_YOBIBYTE;
26 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_YOTTABYTE;
27 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_ZEBIBYTE;
28 import static de.xn__ho_hia.storage_unit.StorageUnit.BYTES_IN_A_ZETTABYTE;
29 import static de.xn__ho_hia.storage_unit.StorageUnit.DEFAULT_FORMAT_PATTERN;
31 import java.math.BigInteger;
32 import java.text.DecimalFormat;
33 import java.text.Format;
34 import java.util.Locale;
36 import org.eclipse.jdt.annotation.NonNull;
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
51 * bytes.
53 @NonNull
54 public static StorageUnit<?> binaryValueOf(final long bytes) {
55 return binaryValueOf(asBigInteger(bytes));
58 /**
59 * @param bytes
60 * The amount to bytes to represent.
61 * @return The appropriate binary-prefixed unit for the given amount of
62 * bytes.
64 @NonNull
65 public static StorageUnit<?> binaryValueOf(@NonNull final BigInteger bytes) {
66 StorageUnit<?> unit = Byte.valueOf(bytes);
67 @NonNull
68 final BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? nonNull(bytes.negate()) : bytes;
70 if (inbetween(BYTES_IN_A_KIBIBYTE, positiveNumberOfBytes, BYTES_IN_A_MEBIBYTE)) {
71 unit = unit.asKibibyte();
72 } else if (inbetween(BYTES_IN_A_MEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_GIBIBYTE)) {
73 unit = unit.asMebibyte();
74 } else if (inbetween(BYTES_IN_A_GIBIBYTE, positiveNumberOfBytes, BYTES_IN_A_TEBIBYTE)) {
75 unit = unit.asGibibyte();
76 } else if (inbetween(BYTES_IN_A_TEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_PEBIBYTE)) {
77 unit = unit.asTebibyte();
78 } else if (inbetween(BYTES_IN_A_PEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_EXBIBYTE)) {
79 unit = unit.asPebibyte();
80 } else if (inbetween(BYTES_IN_A_EXBIBYTE, positiveNumberOfBytes, BYTES_IN_A_ZEBIBYTE)) {
81 unit = unit.asExbibyte();
82 } else if (inbetween(BYTES_IN_A_ZEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_YOBIBYTE)) {
83 unit = unit.asZebibyte();
84 } else if (greaterThanEquals(positiveNumberOfBytes, BYTES_IN_A_YOBIBYTE)) {
85 unit = unit.asYobibyte();
88 return unit;
91 /**
92 * @param bytes
93 * The amount of bytes to represent.
94 * @return The appropriate metric-prefixed unit for the given amount of
95 * bytes.
97 @NonNull
98 public static StorageUnit<?> metricValueOf(final long bytes) {
99 return metricValueOf(asBigInteger(bytes));
103 * @param bytes
104 * The amount of bytes to represent.
105 * @return The appropriate metric-prefixed unit for the given amount of
106 * bytes.
108 @NonNull
109 public static StorageUnit<?> metricValueOf(@NonNull final BigInteger bytes) {
110 StorageUnit<?> unit = Byte.valueOf(bytes);
111 @NonNull
112 final BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? nonNull(bytes.negate()) : bytes;
114 if (inbetween(BYTES_IN_A_KILOBYTE, positiveNumberOfBytes, BYTES_IN_A_MEGABYTE)) {
115 unit = unit.asKilobyte();
116 } else if (inbetween(BYTES_IN_A_MEGABYTE, positiveNumberOfBytes, BYTES_IN_A_GIGABYTE)) {
117 unit = unit.asMegabyte();
118 } else if (inbetween(BYTES_IN_A_GIGABYTE, positiveNumberOfBytes, BYTES_IN_A_TERABYTE)) {
119 unit = unit.asGigabyte();
120 } else if (inbetween(BYTES_IN_A_TERABYTE, positiveNumberOfBytes, BYTES_IN_A_PETABYTE)) {
121 unit = unit.asTerabyte();
122 } else if (inbetween(BYTES_IN_A_PETABYTE, positiveNumberOfBytes, BYTES_IN_A_EXABYTE)) {
123 unit = unit.asPetabyte();
124 } else if (inbetween(BYTES_IN_A_EXABYTE, positiveNumberOfBytes, BYTES_IN_A_ZETTABYTE)) {
125 unit = unit.asExabyte();
126 } else if (inbetween(BYTES_IN_A_ZETTABYTE, positiveNumberOfBytes, BYTES_IN_A_YOTTABYTE)) {
127 unit = unit.asZettabyte();
128 } else if (greaterThanEquals(positiveNumberOfBytes, BYTES_IN_A_YOTTABYTE)) {
129 unit = unit.asYottabyte();
132 return unit;
136 * @param bytes
137 * The amount to bytes to represent.
138 * @return The appropriate common unit for the given amount of bytes.
140 @NonNull
141 public static StorageUnit<?> commonValueOf(final long bytes) {
142 return commonValueOf(asBigInteger(bytes));
146 * @param bytes
147 * The amount to bytes to represent.
148 * @return The appropriate common unit for the given amount of bytes.
150 @NonNull
151 public static StorageUnit<?> commonValueOf(@NonNull final BigInteger bytes) {
152 StorageUnit<?> unit = Byte.valueOf(bytes);
153 @NonNull
154 final BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? nonNull(bytes.negate()) : bytes;
156 if (inbetween(BYTES_IN_A_KIBIBYTE, positiveNumberOfBytes, BYTES_IN_A_MEBIBYTE)) {
157 unit = unit.asCommonKilobyte();
158 } else if (inbetween(BYTES_IN_A_MEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_GIBIBYTE)) {
159 unit = unit.asCommonMegabyte();
160 } else if (inbetween(BYTES_IN_A_GIBIBYTE, positiveNumberOfBytes, BYTES_IN_A_TEBIBYTE)) {
161 unit = unit.asCommonGigabyte();
162 } else if (inbetween(BYTES_IN_A_TEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_PEBIBYTE)) {
163 unit = unit.asCommonTerabyte();
164 } else if (inbetween(BYTES_IN_A_PEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_EXBIBYTE)) {
165 unit = unit.asCommonPetabyte();
166 } else if (inbetween(BYTES_IN_A_EXBIBYTE, positiveNumberOfBytes, BYTES_IN_A_ZEBIBYTE)) {
167 unit = unit.asCommonExabyte();
168 } else if (inbetween(BYTES_IN_A_ZEBIBYTE, positiveNumberOfBytes, BYTES_IN_A_YOBIBYTE)) {
169 unit = unit.asCommonZettabyte();
170 } else if (greaterThanEquals(positiveNumberOfBytes, BYTES_IN_A_YOBIBYTE)) {
171 unit = unit.asCommonYottabyte();
174 return unit;
177 private static boolean inbetween(final BigInteger start, final BigInteger value, final BigInteger endExclusive) {
178 return greaterThanEquals(value, start) && value.compareTo(endExclusive) < 0;
181 private static boolean greaterThanEquals(final BigInteger value, final BigInteger comparison) {
182 return value.compareTo(comparison) >= 0;
186 * @param numberOfBytes
187 * The amount of bytes to format.
188 * @return The formatted bytes using the default pattern.
190 @NonNull
191 public static String formatAsByte(@NonNull final Long numberOfBytes) {
192 return formatAsByte(numberOfBytes.longValue());
196 * @param numberOfBytes
197 * The amount of bytes to format.
198 * @return The formatted bytes using the default pattern.
200 @NonNull
201 public static String formatAsByte(final long numberOfBytes) {
202 return formatAsByte(asBigInteger(numberOfBytes));
206 * @param numberOfBytes
207 * The amount of bytes to format.
208 * @return The formatted bytes using the default pattern.
210 @NonNull
211 public static String formatAsByte(@NonNull final BigInteger numberOfBytes) {
212 return numberOfBytes.toString() + " B"; //$NON-NLS-1$
216 * @param numberOfBytes
217 * The amount of bytes to format.
218 * @return The formatted bytes using the default pattern.
220 @NonNull
221 public static String formatAsBinaryUnit(@NonNull final Long numberOfBytes) {
222 return formatAsBinaryUnit(numberOfBytes.longValue());
226 * @param numberOfBytes
227 * The amount of bytes to format.
228 * @return The formatted bytes using the default pattern.
230 @NonNull
231 public static String formatAsBinaryUnit(final long numberOfBytes) {
232 return formatAsBinaryUnit(asBigInteger(numberOfBytes));
236 * @param numberOfBytes
237 * The amount of bytes to format.
238 * @return The formatted bytes using the default pattern.
240 @NonNull
241 public static String formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes) {
242 return formatAsBinaryUnit(numberOfBytes, DEFAULT_FORMAT_PATTERN);
246 * @param numberOfBytes
247 * The amount of bytes to format.
248 * @param pattern
249 * The formatting pattern to apply.
250 * @return The formatted bytes using the default pattern.
252 @NonNull
253 public static String formatAsBinaryUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
254 return formatAsBinaryUnit(numberOfBytes.longValue(), pattern);
258 * @param numberOfBytes
259 * The amount of bytes to format.
260 * @param pattern
261 * The formatting pattern to apply.
262 * @return The formatted bytes using the default pattern.
264 @NonNull
265 public static String formatAsBinaryUnit(final long numberOfBytes, @NonNull final String pattern) {
266 return formatAsBinaryUnit(asBigInteger(numberOfBytes), pattern);
270 * @param numberOfBytes
271 * The amount of bytes to format.
272 * @param pattern
273 * The formatting pattern to apply.
274 * @return The formatted bytes using the default pattern.
276 @NonNull
277 public static String formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
278 return formatAsBinaryUnit(numberOfBytes, new DecimalFormat(pattern));
282 * @param numberOfBytes
283 * The amount of bytes to format.
284 * @param pattern
285 * The formatting pattern to apply.
286 * @param locale
287 * The locale to use.
288 * @return The formatted bytes using the default pattern.
290 @NonNull
291 public static String formatAsBinaryUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern,
292 @NonNull final Locale locale) {
293 return formatAsBinaryUnit(numberOfBytes.longValue(), pattern, locale);
297 * @param numberOfBytes
298 * The amount of bytes to format.
299 * @param pattern
300 * The formatting pattern to apply.
301 * @param locale
302 * The locale to use.
303 * @return The formatted bytes using the default pattern.
305 @NonNull
306 public static String formatAsBinaryUnit(final long numberOfBytes, @NonNull final String pattern,
307 @NonNull final Locale locale) {
308 return formatAsBinaryUnit(asBigInteger(numberOfBytes), pattern, locale);
312 * @param numberOfBytes
313 * The amount of bytes to format.
314 * @param pattern
315 * The formatting pattern to apply.
316 * @param locale
317 * The locale to use.
318 * @return The formatted bytes using the default pattern.
320 @NonNull
321 public static String formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
322 @NonNull final Locale locale) {
323 return formatAsBinaryUnit(numberOfBytes, asFormat(pattern, locale));
327 * @param numberOfBytes
328 * The amount of bytes to format.
329 * @param format
330 * The formatting pattern to apply.
331 * @return The formatted bytes using the default pattern.
333 @NonNull
334 public static String formatAsBinaryUnit(@NonNull final Long numberOfBytes, @NonNull final Format format) {
335 return formatAsBinaryUnit(numberOfBytes.longValue(), format);
339 * @param numberOfBytes
340 * The amount of bytes to format.
341 * @param format
342 * The formatting pattern to apply.
343 * @return The formatted bytes using the default pattern.
345 @NonNull
346 public static String formatAsBinaryUnit(final long numberOfBytes, @NonNull final Format format) {
347 return formatAsBinaryUnit(asBigInteger(numberOfBytes), format);
351 * @param numberOfBytes
352 * The amount of bytes to format.
353 * @param format
354 * The formatting pattern to apply.
355 * @return The formatted bytes using the default pattern.
357 @NonNull
358 public static String formatAsBinaryUnit(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
359 return binaryValueOf(numberOfBytes).toString(format);
363 * @param numberOfBytes
364 * The amount of bytes to format.
365 * @return The formatted bytes using the default pattern.
367 @NonNull
368 public static String formatAsKibibyte(@NonNull final Long numberOfBytes) {
369 return formatAsKibibyte(numberOfBytes.longValue());
373 * @param numberOfBytes
374 * The amount of bytes to format.
375 * @return The formatted bytes using the default pattern.
377 @NonNull
378 public static String formatAsKibibyte(final long numberOfBytes) {
379 return formatAsKibibyte(asBigInteger(numberOfBytes));
383 * @param numberOfBytes
384 * The amount of bytes to format.
385 * @return The formatted bytes using the default pattern.
387 @NonNull
388 public static String formatAsKibibyte(@NonNull final BigInteger numberOfBytes) {
389 return formatAsKibibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
393 * @param numberOfBytes
394 * The amount of bytes to format.
395 * @param pattern
396 * The formatting pattern to apply.
397 * @return The formatted bytes using the default pattern.
399 @NonNull
400 public static String formatAsKibibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
401 return formatAsKibibyte(numberOfBytes.longValue(), pattern);
405 * @param numberOfBytes
406 * The amount of bytes to format.
407 * @param pattern
408 * The formatting pattern to apply.
409 * @return The formatted bytes using the default pattern.
411 @NonNull
412 public static String formatAsKibibyte(final long numberOfBytes, @NonNull final String pattern) {
413 return formatAsKibibyte(asBigInteger(numberOfBytes), pattern);
417 * @param numberOfBytes
418 * The amount of bytes to format.
419 * @param pattern
420 * The formatting pattern to apply.
421 * @return The formatted bytes using the default pattern.
423 @NonNull
424 public static String formatAsKibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
425 return formatAsKibibyte(numberOfBytes, new DecimalFormat(pattern));
429 * @param numberOfBytes
430 * The amount of bytes to format.
431 * @param pattern
432 * The formatting pattern to apply.
433 * @param locale
434 * The locale to use.
435 * @return The formatted bytes using the default pattern.
437 @NonNull
438 public static String formatAsKibibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
439 @NonNull final Locale locale) {
440 return formatAsKibibyte(numberOfBytes.longValue(), pattern, locale);
444 * @param numberOfBytes
445 * The amount of bytes to format.
446 * @param pattern
447 * The formatting pattern to apply.
448 * @param locale
449 * The locale to use.
450 * @return The formatted bytes using the default pattern.
452 @NonNull
453 public static String formatAsKibibyte(final long numberOfBytes, @NonNull final String pattern,
454 @NonNull final Locale locale) {
455 return formatAsKibibyte(asBigInteger(numberOfBytes), pattern, locale);
459 * @param numberOfBytes
460 * The amount of bytes to format.
461 * @param pattern
462 * The formatting pattern to apply.
463 * @param locale
464 * The locale to use.
465 * @return The formatted bytes using the default pattern.
467 @NonNull
468 public static String formatAsKibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
469 @NonNull final Locale locale) {
470 return formatAsKibibyte(numberOfBytes, asFormat(pattern, locale));
474 * @param numberOfBytes
475 * The amount of bytes to format.
476 * @param format
477 * The formatting pattern to apply.
478 * @return The formatted bytes using the default pattern.
480 @NonNull
481 public static String formatAsKibibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
482 return formatAsKibibyte(numberOfBytes.longValue(), format);
486 * @param numberOfBytes
487 * The amount of bytes to format.
488 * @param format
489 * The formatting pattern to apply.
490 * @return The formatted bytes using the default pattern.
492 @NonNull
493 public static String formatAsKibibyte(final long numberOfBytes, @NonNull final Format format) {
494 return formatAsKibibyte(asBigInteger(numberOfBytes), format);
498 * @param numberOfBytes
499 * The amount of bytes to format.
500 * @param format
501 * The formatting pattern to apply.
502 * @return The formatted bytes using the default pattern.
504 @NonNull
505 public static String formatAsKibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
506 return Kibibyte.valueOf(numberOfBytes).toString(format);
510 * @param numberOfBytes
511 * The amount of bytes to format.
512 * @return The formatted bytes using the default pattern.
514 @NonNull
515 public static String formatAsMebibyte(@NonNull final Long numberOfBytes) {
516 return formatAsMebibyte(numberOfBytes.longValue());
520 * @param numberOfBytes
521 * The amount of bytes to format.
522 * @return The formatted bytes using the default pattern.
524 @NonNull
525 public static String formatAsMebibyte(final long numberOfBytes) {
526 return formatAsMebibyte(asBigInteger(numberOfBytes));
530 * @param numberOfBytes
531 * The amount of bytes to format.
532 * @return The formatted bytes using the default pattern.
534 @NonNull
535 public static String formatAsMebibyte(@NonNull final BigInteger numberOfBytes) {
536 return formatAsMebibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
540 * @param numberOfBytes
541 * The amount of bytes to format.
542 * @param pattern
543 * The formatting pattern to apply.
544 * @return The formatted bytes using the default pattern.
546 @NonNull
547 public static String formatAsMebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
548 return formatAsMebibyte(numberOfBytes.longValue(), pattern);
552 * @param numberOfBytes
553 * The amount of bytes to format.
554 * @param pattern
555 * The formatting pattern to apply.
556 * @return The formatted bytes using the default pattern.
558 @NonNull
559 public static String formatAsMebibyte(final long numberOfBytes, @NonNull final String pattern) {
560 return formatAsMebibyte(asBigInteger(numberOfBytes), pattern);
564 * @param numberOfBytes
565 * The amount of bytes to format.
566 * @param pattern
567 * The formatting pattern to apply.
568 * @return The formatted bytes using the default pattern.
570 @NonNull
571 public static String formatAsMebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
572 return formatAsMebibyte(numberOfBytes, new DecimalFormat(pattern));
576 * @param numberOfBytes
577 * The amount of bytes to format.
578 * @param pattern
579 * The formatting pattern to apply.
580 * @param locale
581 * The locale to use.
582 * @return The formatted bytes using the default pattern.
584 @NonNull
585 public static String formatAsMebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
586 @NonNull final Locale locale) {
587 return formatAsMebibyte(numberOfBytes.longValue(), pattern, locale);
591 * @param numberOfBytes
592 * The amount of bytes to format.
593 * @param pattern
594 * The formatting pattern to apply.
595 * @param locale
596 * The locale to use.
597 * @return The formatted bytes using the default pattern.
599 @NonNull
600 public static String formatAsMebibyte(final long numberOfBytes, @NonNull final String pattern,
601 @NonNull final Locale locale) {
602 return formatAsMebibyte(asBigInteger(numberOfBytes), pattern, locale);
606 * @param numberOfBytes
607 * The amount of bytes to format.
608 * @param pattern
609 * The formatting pattern to apply.
610 * @param locale
611 * The locale to use.
612 * @return The formatted bytes using the default pattern.
614 @NonNull
615 public static String formatAsMebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
616 @NonNull final Locale locale) {
617 return formatAsMebibyte(numberOfBytes, asFormat(pattern, locale));
621 * @param numberOfBytes
622 * The amount of bytes to format.
623 * @param format
624 * The formatting pattern to apply.
625 * @return The formatted bytes using the default pattern.
627 @NonNull
628 public static String formatAsMebibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
629 return formatAsMebibyte(numberOfBytes.longValue(), format);
633 * @param numberOfBytes
634 * The amount of bytes to format.
635 * @param format
636 * The formatting pattern to apply.
637 * @return The formatted bytes using the default pattern.
639 @NonNull
640 public static String formatAsMebibyte(final long numberOfBytes, @NonNull final Format format) {
641 return formatAsMebibyte(asBigInteger(numberOfBytes), format);
645 * @param numberOfBytes
646 * The amount of bytes to format.
647 * @param format
648 * The formatting pattern to apply.
649 * @return The formatted bytes using the default pattern.
651 @NonNull
652 public static String formatAsMebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
653 return Mebibyte.valueOf(numberOfBytes).toString(format);
657 * @param numberOfBytes
658 * The amount of bytes to format.
659 * @return The formatted bytes using the default pattern.
661 @NonNull
662 public static String formatAsGibibyte(@NonNull final Long numberOfBytes) {
663 return formatAsGibibyte(numberOfBytes.longValue());
667 * @param numberOfBytes
668 * The amount of bytes to format.
669 * @return The formatted bytes using the default pattern.
671 @NonNull
672 public static String formatAsGibibyte(final long numberOfBytes) {
673 return formatAsGibibyte(asBigInteger(numberOfBytes));
677 * @param numberOfBytes
678 * The amount of bytes to format.
679 * @return The formatted bytes using the default pattern.
681 @NonNull
682 public static String formatAsGibibyte(@NonNull final BigInteger numberOfBytes) {
683 return formatAsGibibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
687 * @param numberOfBytes
688 * The amount of bytes to format.
689 * @param pattern
690 * The formatting pattern to apply.
691 * @return The formatted bytes using the default pattern.
693 @NonNull
694 public static String formatAsGibibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
695 return formatAsGibibyte(numberOfBytes.longValue(), pattern);
699 * @param numberOfBytes
700 * The amount of bytes to format.
701 * @param pattern
702 * The formatting pattern to apply.
703 * @return The formatted bytes using the default pattern.
705 @NonNull
706 public static String formatAsGibibyte(final long numberOfBytes, @NonNull final String pattern) {
707 return formatAsGibibyte(asBigInteger(numberOfBytes), pattern);
711 * @param numberOfBytes
712 * The amount of bytes to format.
713 * @param pattern
714 * The formatting pattern to apply.
715 * @return The formatted bytes using the default pattern.
717 @NonNull
718 public static String formatAsGibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
719 return formatAsGibibyte(numberOfBytes, new DecimalFormat(pattern));
723 * @param numberOfBytes
724 * The amount of bytes to format.
725 * @param pattern
726 * The formatting pattern to apply.
727 * @param locale
728 * The locale to use.
729 * @return The formatted bytes using the default pattern.
731 @NonNull
732 public static String formatAsGibibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
733 @NonNull final Locale locale) {
734 return formatAsGibibyte(numberOfBytes.longValue(), pattern, locale);
738 * @param numberOfBytes
739 * The amount of bytes to format.
740 * @param pattern
741 * The formatting pattern to apply.
742 * @param locale
743 * The locale to use.
744 * @return The formatted bytes using the default pattern.
746 @NonNull
747 public static String formatAsGibibyte(final long numberOfBytes, @NonNull final String pattern,
748 @NonNull final Locale locale) {
749 return formatAsGibibyte(asBigInteger(numberOfBytes), pattern, locale);
753 * @param numberOfBytes
754 * The amount of bytes to format.
755 * @param pattern
756 * The formatting pattern to apply.
757 * @param locale
758 * The locale to use.
759 * @return The formatted bytes using the default pattern.
761 @NonNull
762 public static String formatAsGibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
763 @NonNull final Locale locale) {
764 return formatAsGibibyte(numberOfBytes, asFormat(pattern, locale));
768 * @param numberOfBytes
769 * The amount of bytes to format.
770 * @param format
771 * The formatting pattern to apply.
772 * @return The formatted bytes using the default pattern.
774 @NonNull
775 public static String formatAsGibibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
776 return formatAsGibibyte(numberOfBytes.longValue(), format);
780 * @param numberOfBytes
781 * The amount of bytes to format.
782 * @param format
783 * The formatting pattern to apply.
784 * @return The formatted bytes using the default pattern.
786 @NonNull
787 public static String formatAsGibibyte(final long numberOfBytes, @NonNull final Format format) {
788 return formatAsGibibyte(asBigInteger(numberOfBytes), format);
792 * @param numberOfBytes
793 * The amount of bytes to format.
794 * @param format
795 * The formatting pattern to apply.
796 * @return The formatted bytes using the default pattern.
798 @NonNull
799 public static String formatAsGibibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
800 return Gibibyte.valueOf(numberOfBytes).toString(format);
804 * @param numberOfBytes
805 * The amount of bytes to format.
806 * @return The formatted bytes using the default pattern.
808 @NonNull
809 public static String formatAsTebibyte(@NonNull final Long numberOfBytes) {
810 return formatAsTebibyte(numberOfBytes.longValue());
814 * @param numberOfBytes
815 * The amount of bytes to format.
816 * @return The formatted bytes using the default pattern.
818 @NonNull
819 public static String formatAsTebibyte(final long numberOfBytes) {
820 return formatAsTebibyte(asBigInteger(numberOfBytes));
824 * @param numberOfBytes
825 * The amount of bytes to format.
826 * @return The formatted bytes using the default pattern.
828 @NonNull
829 public static String formatAsTebibyte(@NonNull final BigInteger numberOfBytes) {
830 return formatAsTebibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
834 * @param numberOfBytes
835 * The amount of bytes to format.
836 * @param pattern
837 * The formatting pattern to apply.
838 * @return The formatted bytes using the default pattern.
840 @NonNull
841 public static String formatAsTebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
842 return formatAsTebibyte(numberOfBytes.longValue(), pattern);
846 * @param numberOfBytes
847 * The amount of bytes to format.
848 * @param pattern
849 * The formatting pattern to apply.
850 * @return The formatted bytes using the default pattern.
852 @NonNull
853 public static String formatAsTebibyte(final long numberOfBytes, @NonNull final String pattern) {
854 return formatAsTebibyte(asBigInteger(numberOfBytes), pattern);
858 * @param numberOfBytes
859 * The amount of bytes to format.
860 * @param pattern
861 * The formatting pattern to apply.
862 * @return The formatted bytes using the default pattern.
864 @NonNull
865 public static String formatAsTebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
866 return formatAsTebibyte(numberOfBytes, new DecimalFormat(pattern));
870 * @param numberOfBytes
871 * The amount of bytes to format.
872 * @param pattern
873 * The formatting pattern to apply.
874 * @param locale
875 * The locale to use.
876 * @return The formatted bytes using the default pattern.
878 @NonNull
879 public static String formatAsTebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
880 @NonNull final Locale locale) {
881 return formatAsTebibyte(numberOfBytes.longValue(), pattern, locale);
885 * @param numberOfBytes
886 * The amount of bytes to format.
887 * @param pattern
888 * The formatting pattern to apply.
889 * @param locale
890 * The locale to use.
891 * @return The formatted bytes using the default pattern.
893 @NonNull
894 public static String formatAsTebibyte(final long numberOfBytes, @NonNull final String pattern,
895 @NonNull final Locale locale) {
896 return formatAsTebibyte(asBigInteger(numberOfBytes), pattern, locale);
900 * @param numberOfBytes
901 * The amount of bytes to format.
902 * @param pattern
903 * The formatting pattern to apply.
904 * @param locale
905 * The locale to use.
906 * @return The formatted bytes using the default pattern.
908 @NonNull
909 public static String formatAsTebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
910 @NonNull final Locale locale) {
911 return formatAsTebibyte(numberOfBytes, asFormat(pattern, locale));
915 * @param numberOfBytes
916 * The amount of bytes to format.
917 * @param format
918 * The formatting pattern to apply.
919 * @return The formatted bytes using the default pattern.
921 @NonNull
922 public static String formatAsTebibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
923 return formatAsTebibyte(numberOfBytes.longValue(), format);
927 * @param numberOfBytes
928 * The amount of bytes to format.
929 * @param format
930 * The formatting pattern to apply.
931 * @return The formatted bytes using the default pattern.
933 @NonNull
934 public static String formatAsTebibyte(final long numberOfBytes, @NonNull final Format format) {
935 return formatAsTebibyte(asBigInteger(numberOfBytes), format);
939 * @param numberOfBytes
940 * The amount of bytes to format.
941 * @param format
942 * The formatting pattern to apply.
943 * @return The formatted bytes using the default pattern.
945 @NonNull
946 public static String formatAsTebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
947 return Tebibyte.valueOf(numberOfBytes).toString(format);
951 * @param numberOfBytes
952 * The amount of bytes to format.
953 * @return The formatted bytes using the default pattern.
955 @NonNull
956 public static String formatAsPebibyte(@NonNull final Long numberOfBytes) {
957 return formatAsPebibyte(numberOfBytes.longValue());
961 * @param numberOfBytes
962 * The amount of bytes to format.
963 * @return The formatted bytes using the default pattern.
965 @NonNull
966 public static String formatAsPebibyte(final long numberOfBytes) {
967 return formatAsPebibyte(asBigInteger(numberOfBytes));
971 * @param numberOfBytes
972 * The amount of bytes to format.
973 * @return The formatted bytes using the default pattern.
975 @NonNull
976 public static String formatAsPebibyte(@NonNull final BigInteger numberOfBytes) {
977 return formatAsPebibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
981 * @param numberOfBytes
982 * The amount of bytes to format.
983 * @param pattern
984 * The formatting pattern to apply.
985 * @return The formatted bytes using the default pattern.
987 @NonNull
988 public static String formatAsPebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
989 return formatAsPebibyte(numberOfBytes.longValue(), pattern);
993 * @param numberOfBytes
994 * The amount of bytes to format.
995 * @param pattern
996 * The formatting pattern to apply.
997 * @return The formatted bytes using the default pattern.
999 @NonNull
1000 public static String formatAsPebibyte(final long numberOfBytes, @NonNull final String pattern) {
1001 return formatAsPebibyte(asBigInteger(numberOfBytes), pattern);
1005 * @param numberOfBytes
1006 * The amount of bytes to format.
1007 * @param pattern
1008 * The formatting pattern to apply.
1009 * @return The formatted bytes using the default pattern.
1011 @NonNull
1012 public static String formatAsPebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1013 return formatAsPebibyte(numberOfBytes, new DecimalFormat(pattern));
1017 * @param numberOfBytes
1018 * The amount of bytes to format.
1019 * @param pattern
1020 * The formatting pattern to apply.
1021 * @param locale
1022 * The locale to use.
1023 * @return The formatted bytes using the default pattern.
1025 @NonNull
1026 public static String formatAsPebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1027 @NonNull final Locale locale) {
1028 return formatAsPebibyte(numberOfBytes.longValue(), pattern, locale);
1032 * @param numberOfBytes
1033 * The amount of bytes to format.
1034 * @param pattern
1035 * The formatting pattern to apply.
1036 * @param locale
1037 * The locale to use.
1038 * @return The formatted bytes using the default pattern.
1040 @NonNull
1041 public static String formatAsPebibyte(final long numberOfBytes, @NonNull final String pattern,
1042 @NonNull final Locale locale) {
1043 return formatAsPebibyte(asBigInteger(numberOfBytes), pattern, locale);
1047 * @param numberOfBytes
1048 * The amount of bytes to format.
1049 * @param pattern
1050 * The formatting pattern to apply.
1051 * @param locale
1052 * The locale to use.
1053 * @return The formatted bytes using the default pattern.
1055 @NonNull
1056 public static String formatAsPebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1057 @NonNull final Locale locale) {
1058 return formatAsPebibyte(numberOfBytes, asFormat(pattern, locale));
1062 * @param numberOfBytes
1063 * The amount of bytes to format.
1064 * @param format
1065 * The formatting pattern to apply.
1066 * @return The formatted bytes using the default pattern.
1068 @NonNull
1069 public static String formatAsPebibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1070 return formatAsPebibyte(numberOfBytes.longValue(), format);
1074 * @param numberOfBytes
1075 * The amount of bytes to format.
1076 * @param format
1077 * The formatting pattern to apply.
1078 * @return The formatted bytes using the default pattern.
1080 @NonNull
1081 public static String formatAsPebibyte(final long numberOfBytes, @NonNull final Format format) {
1082 return formatAsPebibyte(asBigInteger(numberOfBytes), format);
1086 * @param numberOfBytes
1087 * The amount of bytes to format.
1088 * @param format
1089 * The formatting pattern to apply.
1090 * @return The formatted bytes using the default pattern.
1092 @NonNull
1093 public static String formatAsPebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1094 return Pebibyte.valueOf(numberOfBytes).toString(format);
1098 * @param numberOfBytes
1099 * The amount of bytes to format.
1100 * @return The formatted bytes using the default pattern.
1102 @NonNull
1103 public static String formatAsExbibyte(@NonNull final Long numberOfBytes) {
1104 return formatAsExbibyte(numberOfBytes.longValue());
1108 * @param numberOfBytes
1109 * The amount of bytes to format.
1110 * @return The formatted bytes using the default pattern.
1112 @NonNull
1113 public static String formatAsExbibyte(final long numberOfBytes) {
1114 return formatAsExbibyte(asBigInteger(numberOfBytes));
1118 * @param numberOfBytes
1119 * The amount of bytes to format.
1120 * @return The formatted bytes using the default pattern.
1122 @NonNull
1123 public static String formatAsExbibyte(@NonNull final BigInteger numberOfBytes) {
1124 return formatAsExbibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1128 * @param numberOfBytes
1129 * The amount of bytes to format.
1130 * @param pattern
1131 * The formatting pattern to apply.
1132 * @return The formatted bytes using the default pattern.
1134 @NonNull
1135 public static String formatAsExbibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1136 return formatAsExbibyte(numberOfBytes.longValue(), pattern);
1140 * @param numberOfBytes
1141 * The amount of bytes to format.
1142 * @param pattern
1143 * The formatting pattern to apply.
1144 * @return The formatted bytes using the default pattern.
1146 @NonNull
1147 public static String formatAsExbibyte(final long numberOfBytes, @NonNull final String pattern) {
1148 return formatAsExbibyte(asBigInteger(numberOfBytes), pattern);
1152 * @param numberOfBytes
1153 * The amount of bytes to format.
1154 * @param pattern
1155 * The formatting pattern to apply.
1156 * @return The formatted bytes using the default pattern.
1158 @NonNull
1159 public static String formatAsExbibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1160 return formatAsExbibyte(numberOfBytes, new DecimalFormat(pattern));
1164 * @param numberOfBytes
1165 * The amount of bytes to format.
1166 * @param pattern
1167 * The formatting pattern to apply.
1168 * @param locale
1169 * The locale to use.
1170 * @return The formatted bytes using the default pattern.
1172 @NonNull
1173 public static String formatAsExbibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1174 @NonNull final Locale locale) {
1175 return formatAsExbibyte(numberOfBytes.longValue(), pattern, locale);
1179 * @param numberOfBytes
1180 * The amount of bytes to format.
1181 * @param pattern
1182 * The formatting pattern to apply.
1183 * @param locale
1184 * The locale to use.
1185 * @return The formatted bytes using the default pattern.
1187 @NonNull
1188 public static String formatAsExbibyte(final long numberOfBytes, @NonNull final String pattern,
1189 @NonNull final Locale locale) {
1190 return formatAsExbibyte(asBigInteger(numberOfBytes), pattern, locale);
1194 * @param numberOfBytes
1195 * The amount of bytes to format.
1196 * @param pattern
1197 * The formatting pattern to apply.
1198 * @param locale
1199 * The locale to use.
1200 * @return The formatted bytes using the default pattern.
1202 @NonNull
1203 public static String formatAsExbibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1204 @NonNull final Locale locale) {
1205 return formatAsExbibyte(numberOfBytes, asFormat(pattern, locale));
1209 * @param numberOfBytes
1210 * The amount of bytes to format.
1211 * @param format
1212 * The formatting pattern to apply.
1213 * @return The formatted bytes using the default pattern.
1215 @NonNull
1216 public static String formatAsExbibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1217 return formatAsExbibyte(numberOfBytes.longValue(), format);
1221 * @param numberOfBytes
1222 * The amount of bytes to format.
1223 * @param format
1224 * The formatting pattern to apply.
1225 * @return The formatted bytes using the default pattern.
1227 @NonNull
1228 public static String formatAsExbibyte(final long numberOfBytes, @NonNull final Format format) {
1229 return formatAsExbibyte(asBigInteger(numberOfBytes), format);
1233 * @param numberOfBytes
1234 * The amount of bytes to format.
1235 * @param format
1236 * The formatting pattern to apply.
1237 * @return The formatted bytes using the default pattern.
1239 @NonNull
1240 public static String formatAsExbibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1241 return Exbibyte.valueOf(numberOfBytes).toString(format);
1245 * @param numberOfBytes
1246 * The amount of bytes to format.
1247 * @return The formatted bytes using the default pattern.
1249 @NonNull
1250 public static String formatAsZebibyte(@NonNull final Long numberOfBytes) {
1251 return formatAsZebibyte(numberOfBytes.longValue());
1255 * @param numberOfBytes
1256 * The amount of bytes to format.
1257 * @return The formatted bytes using the default pattern.
1259 @NonNull
1260 public static String formatAsZebibyte(final long numberOfBytes) {
1261 return formatAsZebibyte(asBigInteger(numberOfBytes));
1265 * @param numberOfBytes
1266 * The amount of bytes to format.
1267 * @return The formatted bytes using the default pattern.
1269 @NonNull
1270 public static String formatAsZebibyte(@NonNull final BigInteger numberOfBytes) {
1271 return formatAsZebibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1275 * @param numberOfBytes
1276 * The amount of bytes to format.
1277 * @param pattern
1278 * The formatting pattern to apply.
1279 * @return The formatted bytes using the default pattern.
1281 @NonNull
1282 public static String formatAsZebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1283 return formatAsZebibyte(numberOfBytes.longValue(), pattern);
1287 * @param numberOfBytes
1288 * The amount of bytes to format.
1289 * @param pattern
1290 * The formatting pattern to apply.
1291 * @return The formatted bytes using the default pattern.
1293 @NonNull
1294 public static String formatAsZebibyte(final long numberOfBytes, @NonNull final String pattern) {
1295 return formatAsZebibyte(asBigInteger(numberOfBytes), pattern);
1299 * @param numberOfBytes
1300 * The amount of bytes to format.
1301 * @param pattern
1302 * The formatting pattern to apply.
1303 * @return The formatted bytes using the default pattern.
1305 @NonNull
1306 public static String formatAsZebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1307 return formatAsZebibyte(numberOfBytes, new DecimalFormat(pattern));
1311 * @param numberOfBytes
1312 * The amount of bytes to format.
1313 * @param pattern
1314 * The formatting pattern to apply.
1315 * @param locale
1316 * The locale to use.
1317 * @return The formatted bytes using the default pattern.
1319 @NonNull
1320 public static String formatAsZebibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1321 @NonNull final Locale locale) {
1322 return formatAsZebibyte(numberOfBytes.longValue(), pattern, locale);
1326 * @param numberOfBytes
1327 * The amount of bytes to format.
1328 * @param pattern
1329 * The formatting pattern to apply.
1330 * @param locale
1331 * The locale to use.
1332 * @return The formatted bytes using the default pattern.
1334 @NonNull
1335 public static String formatAsZebibyte(final long numberOfBytes, @NonNull final String pattern,
1336 @NonNull final Locale locale) {
1337 return formatAsZebibyte(asBigInteger(numberOfBytes), pattern, locale);
1341 * @param numberOfBytes
1342 * The amount of bytes to format.
1343 * @param pattern
1344 * The formatting pattern to apply.
1345 * @param locale
1346 * The locale to use.
1347 * @return The formatted bytes using the default pattern.
1349 @NonNull
1350 public static String formatAsZebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1351 @NonNull final Locale locale) {
1352 return formatAsZebibyte(numberOfBytes, asFormat(pattern, locale));
1356 * @param numberOfBytes
1357 * The amount of bytes to format.
1358 * @param format
1359 * The formatting pattern to apply.
1360 * @return The formatted bytes using the default pattern.
1362 @NonNull
1363 public static String formatAsZebibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1364 return formatAsZebibyte(numberOfBytes.longValue(), format);
1368 * @param numberOfBytes
1369 * The amount of bytes to format.
1370 * @param format
1371 * The formatting pattern to apply.
1372 * @return The formatted bytes using the default pattern.
1374 @NonNull
1375 public static String formatAsZebibyte(final long numberOfBytes, @NonNull final Format format) {
1376 return formatAsZebibyte(asBigInteger(numberOfBytes), format);
1380 * @param numberOfBytes
1381 * The amount of bytes to format.
1382 * @param format
1383 * The formatting pattern to apply.
1384 * @return The formatted bytes using the default pattern.
1386 @NonNull
1387 public static String formatAsZebibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1388 return Zebibyte.valueOf(numberOfBytes).toString(format);
1392 * @param numberOfBytes
1393 * The amount of bytes to format.
1394 * @return The formatted bytes using the default pattern.
1396 @NonNull
1397 public static String formatAsYobibyte(@NonNull final Long numberOfBytes) {
1398 return formatAsYobibyte(numberOfBytes.longValue());
1402 * @param numberOfBytes
1403 * The amount of bytes to format.
1404 * @return The formatted bytes using the default pattern.
1406 @NonNull
1407 public static String formatAsYobibyte(final long numberOfBytes) {
1408 return formatAsYobibyte(asBigInteger(numberOfBytes));
1412 * @param numberOfBytes
1413 * The amount of bytes to format.
1414 * @return The formatted bytes using the default pattern.
1416 @NonNull
1417 public static String formatAsYobibyte(@NonNull final BigInteger numberOfBytes) {
1418 return formatAsYobibyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1422 * @param numberOfBytes
1423 * The amount of bytes to format.
1424 * @param pattern
1425 * The formatting pattern to apply.
1426 * @return The formatted bytes using the default pattern.
1428 @NonNull
1429 public static String formatAsYobibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1430 return formatAsYobibyte(numberOfBytes.longValue(), pattern);
1434 * @param numberOfBytes
1435 * The amount of bytes to format.
1436 * @param pattern
1437 * The formatting pattern to apply.
1438 * @return The formatted bytes using the default pattern.
1440 @NonNull
1441 public static String formatAsYobibyte(final long numberOfBytes, @NonNull final String pattern) {
1442 return formatAsYobibyte(asBigInteger(numberOfBytes), pattern);
1446 * @param numberOfBytes
1447 * The amount of bytes to format.
1448 * @param pattern
1449 * The formatting pattern to apply.
1450 * @return The formatted bytes using the default pattern.
1452 @NonNull
1453 public static String formatAsYobibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1454 return formatAsYobibyte(numberOfBytes, new DecimalFormat(pattern));
1458 * @param numberOfBytes
1459 * The amount of bytes to format.
1460 * @param pattern
1461 * The formatting pattern to apply.
1462 * @param locale
1463 * The locale to use.
1464 * @return The formatted bytes using the default pattern.
1466 @NonNull
1467 public static String formatAsYobibyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1468 @NonNull final Locale locale) {
1469 return formatAsYobibyte(numberOfBytes.longValue(), pattern, locale);
1473 * @param numberOfBytes
1474 * The amount of bytes to format.
1475 * @param pattern
1476 * The formatting pattern to apply.
1477 * @param locale
1478 * The locale to use.
1479 * @return The formatted bytes using the default pattern.
1481 @NonNull
1482 public static String formatAsYobibyte(final long numberOfBytes, @NonNull final String pattern,
1483 @NonNull final Locale locale) {
1484 return formatAsYobibyte(asBigInteger(numberOfBytes), pattern, locale);
1488 * @param numberOfBytes
1489 * The amount of bytes to format.
1490 * @param pattern
1491 * The formatting pattern to apply.
1492 * @param locale
1493 * The locale to use.
1494 * @return The formatted bytes using the default pattern.
1496 @NonNull
1497 public static String formatAsYobibyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1498 @NonNull final Locale locale) {
1499 return formatAsYobibyte(numberOfBytes, asFormat(pattern, locale));
1503 * @param numberOfBytes
1504 * The amount of bytes to format.
1505 * @param format
1506 * The formatting pattern to apply.
1507 * @return The formatted bytes using the default pattern.
1509 @NonNull
1510 public static String formatAsYobibyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1511 return formatAsYobibyte(numberOfBytes.longValue(), format);
1515 * @param numberOfBytes
1516 * The amount of bytes to format.
1517 * @param format
1518 * The formatting pattern to apply.
1519 * @return The formatted bytes using the default pattern.
1521 @NonNull
1522 public static String formatAsYobibyte(final long numberOfBytes, @NonNull final Format format) {
1523 return formatAsYobibyte(asBigInteger(numberOfBytes), format);
1527 * @param numberOfBytes
1528 * The amount of bytes to format.
1529 * @param format
1530 * The formatting pattern to apply.
1531 * @return The formatted bytes using the default pattern.
1533 @NonNull
1534 public static String formatAsYobibyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1535 return Yobibyte.valueOf(numberOfBytes).toString(format);
1539 * @param numberOfBytes
1540 * The amount of bytes to format.
1541 * @return The formatted bytes using the default pattern.
1543 @NonNull
1544 public static String formatAsMetricUnit(@NonNull final Long numberOfBytes) {
1545 return formatAsMetricUnit(numberOfBytes.longValue());
1549 * @param numberOfBytes
1550 * The amount of bytes to format.
1551 * @return The formatted bytes using the default pattern.
1553 @NonNull
1554 public static String formatAsMetricUnit(final long numberOfBytes) {
1555 return formatAsMetricUnit(asBigInteger(numberOfBytes));
1559 * @param numberOfBytes
1560 * The amount of bytes to format.
1561 * @return The formatted bytes using the default pattern.
1563 @NonNull
1564 public static String formatAsMetricUnit(@NonNull final BigInteger numberOfBytes) {
1565 return formatAsMetricUnit(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1569 * @param numberOfBytes
1570 * The amount of bytes to format.
1571 * @param pattern
1572 * The formatting pattern to apply.
1573 * @return The formatted bytes using the default pattern.
1575 @NonNull
1576 public static String formatAsMetricUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1577 return formatAsMetricUnit(numberOfBytes.longValue(), pattern);
1581 * @param numberOfBytes
1582 * The amount of bytes to format.
1583 * @param pattern
1584 * The formatting pattern to apply.
1585 * @return The formatted bytes using the default pattern.
1587 @NonNull
1588 public static String formatAsMetricUnit(final long numberOfBytes, @NonNull final String pattern) {
1589 return formatAsMetricUnit(asBigInteger(numberOfBytes), pattern);
1593 * @param numberOfBytes
1594 * The amount of bytes to format.
1595 * @param pattern
1596 * The formatting pattern to apply.
1597 * @return The formatted bytes using the default pattern.
1599 @NonNull
1600 public static String formatAsMetricUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1601 return formatAsMetricUnit(numberOfBytes, new DecimalFormat(pattern));
1605 * @param numberOfBytes
1606 * The amount of bytes to format.
1607 * @param pattern
1608 * The formatting pattern to apply.
1609 * @param locale
1610 * The locale to use.
1611 * @return The formatted bytes using the default pattern.
1613 @NonNull
1614 public static String formatAsMetricUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1615 @NonNull final Locale locale) {
1616 return formatAsMetricUnit(numberOfBytes.longValue(), pattern, locale);
1620 * @param numberOfBytes
1621 * The amount of bytes to format.
1622 * @param pattern
1623 * The formatting pattern to apply.
1624 * @param locale
1625 * The locale to use.
1626 * @return The formatted bytes using the default pattern.
1628 @NonNull
1629 public static String formatAsMetricUnit(final long numberOfBytes, @NonNull final String pattern,
1630 @NonNull final Locale locale) {
1631 return formatAsMetricUnit(asBigInteger(numberOfBytes), pattern, locale);
1635 * @param numberOfBytes
1636 * The amount of bytes to format.
1637 * @param pattern
1638 * The formatting pattern to apply.
1639 * @param locale
1640 * The locale to use.
1641 * @return The formatted bytes using the default pattern.
1643 @NonNull
1644 public static String formatAsMetricUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1645 @NonNull final Locale locale) {
1646 return formatAsMetricUnit(numberOfBytes, asFormat(pattern, locale));
1650 * @param numberOfBytes
1651 * The amount of bytes to format.
1652 * @param format
1653 * The formatting pattern to apply.
1654 * @return The formatted bytes using the default pattern.
1656 @NonNull
1657 public static String formatAsMetricUnit(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1658 return formatAsMetricUnit(numberOfBytes.longValue(), format);
1662 * @param numberOfBytes
1663 * The amount of bytes to format.
1664 * @param format
1665 * The formatting pattern to apply.
1666 * @return The formatted bytes using the default pattern.
1668 @NonNull
1669 public static String formatAsMetricUnit(final long numberOfBytes, @NonNull final Format format) {
1670 return formatAsMetricUnit(asBigInteger(numberOfBytes), format);
1674 * @param numberOfBytes
1675 * The amount of bytes to format.
1676 * @param format
1677 * The formatting pattern to apply.
1678 * @return The formatted bytes using the default pattern.
1680 @NonNull
1681 public static String formatAsMetricUnit(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1682 return metricValueOf(numberOfBytes).toString(format);
1686 * @param numberOfBytes
1687 * The amount of bytes to format.
1688 * @return The formatted bytes using the default pattern.
1690 @NonNull
1691 public static String formatAsKilobyte(@NonNull final Long numberOfBytes) {
1692 return formatAsKilobyte(numberOfBytes.longValue());
1696 * @param numberOfBytes
1697 * The amount of bytes to format.
1698 * @return The formatted bytes using the default pattern.
1700 @NonNull
1701 public static String formatAsKilobyte(final long numberOfBytes) {
1702 return formatAsKilobyte(asBigInteger(numberOfBytes));
1706 * @param numberOfBytes
1707 * The amount of bytes to format.
1708 * @return The formatted bytes using the default pattern.
1710 @NonNull
1711 public static String formatAsKilobyte(@NonNull final BigInteger numberOfBytes) {
1712 return formatAsKilobyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1716 * @param numberOfBytes
1717 * The amount of bytes to format.
1718 * @param pattern
1719 * The formatting pattern to apply.
1720 * @return The formatted bytes using the default pattern.
1722 @NonNull
1723 public static String formatAsKilobyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1724 return formatAsKilobyte(numberOfBytes.longValue(), pattern);
1728 * @param numberOfBytes
1729 * The amount of bytes to format.
1730 * @param pattern
1731 * The formatting pattern to apply.
1732 * @return The formatted bytes using the default pattern.
1734 @NonNull
1735 public static String formatAsKilobyte(final long numberOfBytes, @NonNull final String pattern) {
1736 return formatAsKilobyte(asBigInteger(numberOfBytes), pattern);
1740 * @param numberOfBytes
1741 * The amount of bytes to format.
1742 * @param pattern
1743 * The formatting pattern to apply.
1744 * @return The formatted bytes using the default pattern.
1746 @NonNull
1747 public static String formatAsKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1748 return formatAsKilobyte(numberOfBytes, new DecimalFormat(pattern));
1752 * @param numberOfBytes
1753 * The amount of bytes to format.
1754 * @param pattern
1755 * The formatting pattern to apply.
1756 * @param locale
1757 * The locale to use.
1758 * @return The formatted bytes using the default pattern.
1760 @NonNull
1761 public static String formatAsKilobyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1762 @NonNull final Locale locale) {
1763 return formatAsKilobyte(numberOfBytes.longValue(), pattern, locale);
1767 * @param numberOfBytes
1768 * The amount of bytes to format.
1769 * @param pattern
1770 * The formatting pattern to apply.
1771 * @param locale
1772 * The locale to use.
1773 * @return The formatted bytes using the default pattern.
1775 @NonNull
1776 public static String formatAsKilobyte(final long numberOfBytes, @NonNull final String pattern,
1777 @NonNull final Locale locale) {
1778 return formatAsKilobyte(asBigInteger(numberOfBytes), pattern, locale);
1782 * @param numberOfBytes
1783 * The amount of bytes to format.
1784 * @param pattern
1785 * The formatting pattern to apply.
1786 * @param locale
1787 * The locale to use.
1788 * @return The formatted bytes using the default pattern.
1790 @NonNull
1791 public static String formatAsKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1792 @NonNull final Locale locale) {
1793 return formatAsKilobyte(numberOfBytes, asFormat(pattern, locale));
1797 * @param numberOfBytes
1798 * The amount of bytes to format.
1799 * @param format
1800 * The formatting pattern to apply.
1801 * @return The formatted bytes using the default pattern.
1803 @NonNull
1804 public static String formatAsKilobyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1805 return formatAsKilobyte(numberOfBytes.longValue(), format);
1809 * @param numberOfBytes
1810 * The amount of bytes to format.
1811 * @param format
1812 * The formatting pattern to apply.
1813 * @return The formatted bytes using the default pattern.
1815 @NonNull
1816 public static String formatAsKilobyte(final long numberOfBytes, @NonNull final Format format) {
1817 return formatAsKilobyte(asBigInteger(numberOfBytes), format);
1821 * @param numberOfBytes
1822 * The amount of bytes to format.
1823 * @param format
1824 * The formatting pattern to apply.
1825 * @return The formatted bytes using the default pattern.
1827 @NonNull
1828 public static String formatAsKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1829 return Kilobyte.valueOf(numberOfBytes).toString(format);
1833 * @param numberOfBytes
1834 * The amount of bytes to format.
1835 * @return The formatted bytes using the default pattern.
1837 @NonNull
1838 public static String formatAsMegabyte(@NonNull final Long numberOfBytes) {
1839 return formatAsMegabyte(numberOfBytes.longValue());
1843 * @param numberOfBytes
1844 * The amount of bytes to format.
1845 * @return The formatted bytes using the default pattern.
1847 @NonNull
1848 public static String formatAsMegabyte(final long numberOfBytes) {
1849 return formatAsMegabyte(asBigInteger(numberOfBytes));
1853 * @param numberOfBytes
1854 * The amount of bytes to format.
1855 * @return The formatted bytes using the default pattern.
1857 @NonNull
1858 public static String formatAsMegabyte(@NonNull final BigInteger numberOfBytes) {
1859 return formatAsMegabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
1863 * @param numberOfBytes
1864 * The amount of bytes to format.
1865 * @param pattern
1866 * The formatting pattern to apply.
1867 * @return The formatted bytes using the default pattern.
1869 @NonNull
1870 public static String formatAsMegabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
1871 return formatAsMegabyte(numberOfBytes.longValue(), pattern);
1875 * @param numberOfBytes
1876 * The amount of bytes to format.
1877 * @param pattern
1878 * The formatting pattern to apply.
1879 * @return The formatted bytes using the default pattern.
1881 @NonNull
1882 public static String formatAsMegabyte(final long numberOfBytes, @NonNull final String pattern) {
1883 return formatAsMegabyte(asBigInteger(numberOfBytes), pattern);
1887 * @param numberOfBytes
1888 * The amount of bytes to format.
1889 * @param pattern
1890 * The formatting pattern to apply.
1891 * @return The formatted bytes using the default pattern.
1893 @NonNull
1894 public static String formatAsMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
1895 return formatAsMegabyte(numberOfBytes, new DecimalFormat(pattern));
1899 * @param numberOfBytes
1900 * The amount of bytes to format.
1901 * @param pattern
1902 * The formatting pattern to apply.
1903 * @param locale
1904 * The locale to use.
1905 * @return The formatted bytes using the default pattern.
1907 @NonNull
1908 public static String formatAsMegabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
1909 @NonNull final Locale locale) {
1910 return formatAsMegabyte(numberOfBytes.longValue(), pattern, locale);
1914 * @param numberOfBytes
1915 * The amount of bytes to format.
1916 * @param pattern
1917 * The formatting pattern to apply.
1918 * @param locale
1919 * The locale to use.
1920 * @return The formatted bytes using the default pattern.
1922 @NonNull
1923 public static String formatAsMegabyte(final long numberOfBytes, @NonNull final String pattern,
1924 @NonNull final Locale locale) {
1925 return formatAsMegabyte(asBigInteger(numberOfBytes), pattern, locale);
1929 * @param numberOfBytes
1930 * The amount of bytes to format.
1931 * @param pattern
1932 * The formatting pattern to apply.
1933 * @param locale
1934 * The locale to use.
1935 * @return The formatted bytes using the default pattern.
1937 @NonNull
1938 public static String formatAsMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
1939 @NonNull final Locale locale) {
1940 return formatAsMegabyte(numberOfBytes, asFormat(pattern, locale));
1944 * @param numberOfBytes
1945 * The amount of bytes to format.
1946 * @param format
1947 * The formatting pattern to apply.
1948 * @return The formatted bytes using the default pattern.
1950 @NonNull
1951 public static String formatAsMegabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
1952 return formatAsMegabyte(numberOfBytes.longValue(), format);
1956 * @param numberOfBytes
1957 * The amount of bytes to format.
1958 * @param format
1959 * The formatting pattern to apply.
1960 * @return The formatted bytes using the default pattern.
1962 @NonNull
1963 public static String formatAsMegabyte(final long numberOfBytes, @NonNull final Format format) {
1964 return formatAsMegabyte(asBigInteger(numberOfBytes), format);
1968 * @param numberOfBytes
1969 * The amount of bytes to format.
1970 * @param format
1971 * The formatting pattern to apply.
1972 * @return The formatted bytes using the default pattern.
1974 @NonNull
1975 public static String formatAsMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
1976 return Megabyte.valueOf(numberOfBytes).toString(format);
1980 * @param numberOfBytes
1981 * The amount of bytes to format.
1982 * @return The formatted bytes using the default pattern.
1984 @NonNull
1985 public static String formatAsGigabyte(@NonNull final Long numberOfBytes) {
1986 return formatAsGigabyte(numberOfBytes.longValue());
1990 * @param numberOfBytes
1991 * The amount of bytes to format.
1992 * @return The formatted bytes using the default pattern.
1994 @NonNull
1995 public static String formatAsGigabyte(final long numberOfBytes) {
1996 return formatAsGigabyte(asBigInteger(numberOfBytes));
2000 * @param numberOfBytes
2001 * The amount of bytes to format.
2002 * @return The formatted bytes using the default pattern.
2004 @NonNull
2005 public static String formatAsGigabyte(@NonNull final BigInteger numberOfBytes) {
2006 return formatAsGigabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2010 * @param numberOfBytes
2011 * The amount of bytes to format.
2012 * @param pattern
2013 * The formatting pattern to apply.
2014 * @return The formatted bytes using the default pattern.
2016 @NonNull
2017 public static String formatAsGigabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2018 return formatAsGigabyte(numberOfBytes.longValue(), pattern);
2022 * @param numberOfBytes
2023 * The amount of bytes to format.
2024 * @param pattern
2025 * The formatting pattern to apply.
2026 * @return The formatted bytes using the default pattern.
2028 @NonNull
2029 public static String formatAsGigabyte(final long numberOfBytes, @NonNull final String pattern) {
2030 return formatAsGigabyte(asBigInteger(numberOfBytes), pattern);
2034 * @param numberOfBytes
2035 * The amount of bytes to format.
2036 * @param pattern
2037 * The formatting pattern to apply.
2038 * @return The formatted bytes using the default pattern.
2040 @NonNull
2041 public static String formatAsGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2042 return formatAsGigabyte(numberOfBytes, new DecimalFormat(pattern));
2046 * @param numberOfBytes
2047 * The amount of bytes to format.
2048 * @param pattern
2049 * The formatting pattern to apply.
2050 * @param locale
2051 * The locale to use.
2052 * @return The formatted bytes using the default pattern.
2054 @NonNull
2055 public static String formatAsGigabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2056 @NonNull final Locale locale) {
2057 return formatAsGigabyte(numberOfBytes.longValue(), pattern, locale);
2061 * @param numberOfBytes
2062 * The amount of bytes to format.
2063 * @param pattern
2064 * The formatting pattern to apply.
2065 * @param locale
2066 * The locale to use.
2067 * @return The formatted bytes using the default pattern.
2069 @NonNull
2070 public static String formatAsGigabyte(final long numberOfBytes, @NonNull final String pattern,
2071 @NonNull final Locale locale) {
2072 return formatAsGigabyte(asBigInteger(numberOfBytes), pattern, locale);
2076 * @param numberOfBytes
2077 * The amount of bytes to format.
2078 * @param pattern
2079 * The formatting pattern to apply.
2080 * @param locale
2081 * The locale to use.
2082 * @return The formatted bytes using the default pattern.
2084 @NonNull
2085 public static String formatAsGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2086 @NonNull final Locale locale) {
2087 return formatAsGigabyte(numberOfBytes, asFormat(pattern, locale));
2091 * @param numberOfBytes
2092 * The amount of bytes to format.
2093 * @param format
2094 * The formatting pattern to apply.
2095 * @return The formatted bytes using the default pattern.
2097 @NonNull
2098 public static String formatAsGigabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2099 return formatAsGigabyte(numberOfBytes.longValue(), format);
2103 * @param numberOfBytes
2104 * The amount of bytes to format.
2105 * @param format
2106 * The formatting pattern to apply.
2107 * @return The formatted bytes using the default pattern.
2109 @NonNull
2110 public static String formatAsGigabyte(final long numberOfBytes, @NonNull final Format format) {
2111 return formatAsGigabyte(asBigInteger(numberOfBytes), format);
2115 * @param numberOfBytes
2116 * The amount of bytes to format.
2117 * @param format
2118 * The formatting pattern to apply.
2119 * @return The formatted bytes using the default pattern.
2121 @NonNull
2122 public static String formatAsGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2123 return Gigabyte.valueOf(numberOfBytes).toString(format);
2127 * @param numberOfBytes
2128 * The amount of bytes to format.
2129 * @return The formatted bytes using the default pattern.
2131 @NonNull
2132 public static String formatAsTerabyte(@NonNull final Long numberOfBytes) {
2133 return formatAsTerabyte(numberOfBytes.longValue());
2137 * @param numberOfBytes
2138 * The amount of bytes to format.
2139 * @return The formatted bytes using the default pattern.
2141 @NonNull
2142 public static String formatAsTerabyte(final long numberOfBytes) {
2143 return formatAsTerabyte(asBigInteger(numberOfBytes));
2147 * @param numberOfBytes
2148 * The amount of bytes to format.
2149 * @return The formatted bytes using the default pattern.
2151 @NonNull
2152 public static String formatAsTerabyte(@NonNull final BigInteger numberOfBytes) {
2153 return formatAsTerabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2157 * @param numberOfBytes
2158 * The amount of bytes to format.
2159 * @param pattern
2160 * The formatting pattern to apply.
2161 * @return The formatted bytes using the default pattern.
2163 @NonNull
2164 public static String formatAsTerabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2165 return formatAsTerabyte(numberOfBytes.longValue(), pattern);
2169 * @param numberOfBytes
2170 * The amount of bytes to format.
2171 * @param pattern
2172 * The formatting pattern to apply.
2173 * @return The formatted bytes using the default pattern.
2175 @NonNull
2176 public static String formatAsTerabyte(final long numberOfBytes, @NonNull final String pattern) {
2177 return formatAsTerabyte(asBigInteger(numberOfBytes), pattern);
2181 * @param numberOfBytes
2182 * The amount of bytes to format.
2183 * @param pattern
2184 * The formatting pattern to apply.
2185 * @return The formatted bytes using the default pattern.
2187 @NonNull
2188 public static String formatAsTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2189 return formatAsTerabyte(numberOfBytes, new DecimalFormat(pattern));
2193 * @param numberOfBytes
2194 * The amount of bytes to format.
2195 * @param pattern
2196 * The formatting pattern to apply.
2197 * @param locale
2198 * The locale to use.
2199 * @return The formatted bytes using the default pattern.
2201 @NonNull
2202 public static String formatAsTerabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2203 @NonNull final Locale locale) {
2204 return formatAsTerabyte(numberOfBytes.longValue(), pattern, locale);
2208 * @param numberOfBytes
2209 * The amount of bytes to format.
2210 * @param pattern
2211 * The formatting pattern to apply.
2212 * @param locale
2213 * The locale to use.
2214 * @return The formatted bytes using the default pattern.
2216 @NonNull
2217 public static String formatAsTerabyte(final long numberOfBytes, @NonNull final String pattern,
2218 @NonNull final Locale locale) {
2219 return formatAsTerabyte(asBigInteger(numberOfBytes), pattern, locale);
2223 * @param numberOfBytes
2224 * The amount of bytes to format.
2225 * @param pattern
2226 * The formatting pattern to apply.
2227 * @param locale
2228 * The locale to use.
2229 * @return The formatted bytes using the default pattern.
2231 @NonNull
2232 public static String formatAsTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2233 @NonNull final Locale locale) {
2234 return formatAsTerabyte(numberOfBytes, asFormat(pattern, locale));
2238 * @param numberOfBytes
2239 * The amount of bytes to format.
2240 * @param format
2241 * The formatting pattern to apply.
2242 * @return The formatted bytes using the default pattern.
2244 @NonNull
2245 public static String formatAsTerabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2246 return formatAsTerabyte(numberOfBytes.longValue(), format);
2250 * @param numberOfBytes
2251 * The amount of bytes to format.
2252 * @param format
2253 * The formatting pattern to apply.
2254 * @return The formatted bytes using the default pattern.
2256 @NonNull
2257 public static String formatAsTerabyte(final long numberOfBytes, @NonNull final Format format) {
2258 return formatAsTerabyte(asBigInteger(numberOfBytes), format);
2262 * @param numberOfBytes
2263 * The amount of bytes to format.
2264 * @param format
2265 * The formatting pattern to apply.
2266 * @return The formatted bytes using the default pattern.
2268 @NonNull
2269 public static String formatAsTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2270 return Terabyte.valueOf(numberOfBytes).toString(format);
2274 * @param numberOfBytes
2275 * The amount of bytes to format.
2276 * @return The formatted bytes using the default pattern.
2278 @NonNull
2279 public static String formatAsPetabyte(@NonNull final Long numberOfBytes) {
2280 return formatAsPetabyte(numberOfBytes.longValue());
2284 * @param numberOfBytes
2285 * The amount of bytes to format.
2286 * @return The formatted bytes using the default pattern.
2288 @NonNull
2289 public static String formatAsPetabyte(final long numberOfBytes) {
2290 return formatAsPetabyte(asBigInteger(numberOfBytes));
2294 * @param numberOfBytes
2295 * The amount of bytes to format.
2296 * @return The formatted bytes using the default pattern.
2298 @NonNull
2299 public static String formatAsPetabyte(@NonNull final BigInteger numberOfBytes) {
2300 return formatAsPetabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2304 * @param numberOfBytes
2305 * The amount of bytes to format.
2306 * @param pattern
2307 * The formatting pattern to apply.
2308 * @return The formatted bytes using the default pattern.
2310 @NonNull
2311 public static String formatAsPetabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2312 return formatAsPetabyte(numberOfBytes.longValue(), pattern);
2316 * @param numberOfBytes
2317 * The amount of bytes to format.
2318 * @param pattern
2319 * The formatting pattern to apply.
2320 * @return The formatted bytes using the default pattern.
2322 @NonNull
2323 public static String formatAsPetabyte(final long numberOfBytes, @NonNull final String pattern) {
2324 return formatAsPetabyte(asBigInteger(numberOfBytes), pattern);
2328 * @param numberOfBytes
2329 * The amount of bytes to format.
2330 * @param pattern
2331 * The formatting pattern to apply.
2332 * @return The formatted bytes using the default pattern.
2334 @NonNull
2335 public static String formatAsPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2336 return formatAsPetabyte(numberOfBytes, new DecimalFormat(pattern));
2340 * @param numberOfBytes
2341 * The amount of bytes to format.
2342 * @param pattern
2343 * The formatting pattern to apply.
2344 * @param locale
2345 * The locale to use.
2346 * @return The formatted bytes using the default pattern.
2348 @NonNull
2349 public static String formatAsPetabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2350 @NonNull final Locale locale) {
2351 return formatAsPetabyte(numberOfBytes.longValue(), pattern, locale);
2355 * @param numberOfBytes
2356 * The amount of bytes to format.
2357 * @param pattern
2358 * The formatting pattern to apply.
2359 * @param locale
2360 * The locale to use.
2361 * @return The formatted bytes using the default pattern.
2363 @NonNull
2364 public static String formatAsPetabyte(final long numberOfBytes, @NonNull final String pattern,
2365 @NonNull final Locale locale) {
2366 return formatAsPetabyte(asBigInteger(numberOfBytes), pattern, locale);
2370 * @param numberOfBytes
2371 * The amount of bytes to format.
2372 * @param pattern
2373 * The formatting pattern to apply.
2374 * @param locale
2375 * The locale to use.
2376 * @return The formatted bytes using the default pattern.
2378 @NonNull
2379 public static String formatAsPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2380 @NonNull final Locale locale) {
2381 return formatAsPetabyte(numberOfBytes, asFormat(pattern, locale));
2385 * @param numberOfBytes
2386 * The amount of bytes to format.
2387 * @param format
2388 * The formatting pattern to apply.
2389 * @return The formatted bytes using the default pattern.
2391 @NonNull
2392 public static String formatAsPetabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2393 return formatAsPetabyte(numberOfBytes.longValue(), format);
2397 * @param numberOfBytes
2398 * The amount of bytes to format.
2399 * @param format
2400 * The formatting pattern to apply.
2401 * @return The formatted bytes using the default pattern.
2403 @NonNull
2404 public static String formatAsPetabyte(final long numberOfBytes, @NonNull final Format format) {
2405 return formatAsPetabyte(asBigInteger(numberOfBytes), format);
2409 * @param numberOfBytes
2410 * The amount of bytes to format.
2411 * @param format
2412 * The formatting pattern to apply.
2413 * @return The formatted bytes using the default pattern.
2415 @NonNull
2416 public static String formatAsPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2417 return Petabyte.valueOf(numberOfBytes).toString(format);
2421 * @param numberOfBytes
2422 * The amount of bytes to format.
2423 * @return The formatted bytes using the default pattern.
2425 @NonNull
2426 public static String formatAsExabyte(@NonNull final Long numberOfBytes) {
2427 return formatAsExabyte(numberOfBytes.longValue());
2431 * @param numberOfBytes
2432 * The amount of bytes to format.
2433 * @return The formatted bytes using the default pattern.
2435 @NonNull
2436 public static String formatAsExabyte(final long numberOfBytes) {
2437 return formatAsExabyte(asBigInteger(numberOfBytes));
2441 * @param numberOfBytes
2442 * The amount of bytes to format.
2443 * @return The formatted bytes using the default pattern.
2445 @NonNull
2446 public static String formatAsExabyte(@NonNull final BigInteger numberOfBytes) {
2447 return formatAsExabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2451 * @param numberOfBytes
2452 * The amount of bytes to format.
2453 * @param pattern
2454 * The formatting pattern to apply.
2455 * @return The formatted bytes using the default pattern.
2457 @NonNull
2458 public static String formatAsExabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2459 return formatAsExabyte(numberOfBytes.longValue(), pattern);
2463 * @param numberOfBytes
2464 * The amount of bytes to format.
2465 * @param pattern
2466 * The formatting pattern to apply.
2467 * @return The formatted bytes using the default pattern.
2469 @NonNull
2470 public static String formatAsExabyte(final long numberOfBytes, @NonNull final String pattern) {
2471 return formatAsExabyte(asBigInteger(numberOfBytes), pattern);
2475 * @param numberOfBytes
2476 * The amount of bytes to format.
2477 * @param pattern
2478 * The formatting pattern to apply.
2479 * @return The formatted bytes using the default pattern.
2481 @NonNull
2482 public static String formatAsExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2483 return formatAsExabyte(numberOfBytes, new DecimalFormat(pattern));
2487 * @param numberOfBytes
2488 * The amount of bytes to format.
2489 * @param pattern
2490 * The formatting pattern to apply.
2491 * @param locale
2492 * The locale to use.
2493 * @return The formatted bytes using the default pattern.
2495 @NonNull
2496 public static String formatAsExabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2497 @NonNull final Locale locale) {
2498 return formatAsExabyte(numberOfBytes.longValue(), pattern, locale);
2502 * @param numberOfBytes
2503 * The amount of bytes to format.
2504 * @param pattern
2505 * The formatting pattern to apply.
2506 * @param locale
2507 * The locale to use.
2508 * @return The formatted bytes using the default pattern.
2510 @NonNull
2511 public static String formatAsExabyte(final long numberOfBytes, @NonNull final String pattern,
2512 @NonNull final Locale locale) {
2513 return formatAsExabyte(asBigInteger(numberOfBytes), pattern, locale);
2517 * @param numberOfBytes
2518 * The amount of bytes to format.
2519 * @param pattern
2520 * The formatting pattern to apply.
2521 * @param locale
2522 * The locale to use.
2523 * @return The formatted bytes using the default pattern.
2525 @NonNull
2526 public static String formatAsExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2527 @NonNull final Locale locale) {
2528 return formatAsExabyte(numberOfBytes, asFormat(pattern, locale));
2532 * @param numberOfBytes
2533 * The amount of bytes to format.
2534 * @param format
2535 * The formatting pattern to apply.
2536 * @return The formatted bytes using the default pattern.
2538 @NonNull
2539 public static String formatAsExabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2540 return formatAsExabyte(numberOfBytes.longValue(), format);
2544 * @param numberOfBytes
2545 * The amount of bytes to format.
2546 * @param format
2547 * The formatting pattern to apply.
2548 * @return The formatted bytes using the default pattern.
2550 @NonNull
2551 public static String formatAsExabyte(final long numberOfBytes, @NonNull final Format format) {
2552 return formatAsExabyte(asBigInteger(numberOfBytes), format);
2556 * @param numberOfBytes
2557 * The amount of bytes to format.
2558 * @param format
2559 * The formatting pattern to apply.
2560 * @return The formatted bytes using the default pattern.
2562 @NonNull
2563 public static String formatAsExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2564 return Exabyte.valueOf(numberOfBytes).toString(format);
2568 * @param numberOfBytes
2569 * The amount of bytes to format.
2570 * @return The formatted bytes using the default pattern.
2572 @NonNull
2573 public static String formatAsZettabyte(@NonNull final Long numberOfBytes) {
2574 return formatAsZettabyte(numberOfBytes.longValue());
2578 * @param numberOfBytes
2579 * The amount of bytes to format.
2580 * @return The formatted bytes using the default pattern.
2582 @NonNull
2583 public static String formatAsZettabyte(final long numberOfBytes) {
2584 return formatAsZettabyte(asBigInteger(numberOfBytes));
2588 * @param numberOfBytes
2589 * The amount of bytes to format.
2590 * @return The formatted bytes using the default pattern.
2592 @NonNull
2593 public static String formatAsZettabyte(@NonNull final BigInteger numberOfBytes) {
2594 return formatAsZettabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2598 * @param numberOfBytes
2599 * The amount of bytes to format.
2600 * @param pattern
2601 * The formatting pattern to apply.
2602 * @return The formatted bytes using the default pattern.
2604 @NonNull
2605 public static String formatAsZettabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2606 return formatAsZettabyte(numberOfBytes.longValue(), pattern);
2610 * @param numberOfBytes
2611 * The amount of bytes to format.
2612 * @param pattern
2613 * The formatting pattern to apply.
2614 * @return The formatted bytes using the default pattern.
2616 @NonNull
2617 public static String formatAsZettabyte(final long numberOfBytes, @NonNull final String pattern) {
2618 return formatAsZettabyte(asBigInteger(numberOfBytes), pattern);
2622 * @param numberOfBytes
2623 * The amount of bytes to format.
2624 * @param pattern
2625 * The formatting pattern to apply.
2626 * @return The formatted bytes using the default pattern.
2628 @NonNull
2629 public static String formatAsZettabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2630 return formatAsZettabyte(numberOfBytes, new DecimalFormat(pattern));
2634 * @param numberOfBytes
2635 * The amount of bytes to format.
2636 * @param pattern
2637 * The formatting pattern to apply.
2638 * @param locale
2639 * The locale to use.
2640 * @return The formatted bytes using the default pattern.
2642 @NonNull
2643 public static String formatAsZettabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2644 @NonNull final Locale locale) {
2645 return formatAsZettabyte(numberOfBytes.longValue(), pattern, locale);
2649 * @param numberOfBytes
2650 * The amount of bytes to format.
2651 * @param pattern
2652 * The formatting pattern to apply.
2653 * @param locale
2654 * The locale to use.
2655 * @return The formatted bytes using the default pattern.
2657 @NonNull
2658 public static String formatAsZettabyte(final long numberOfBytes, @NonNull final String pattern,
2659 @NonNull final Locale locale) {
2660 return formatAsZettabyte(asBigInteger(numberOfBytes), pattern, locale);
2664 * @param numberOfBytes
2665 * The amount of bytes to format.
2666 * @param pattern
2667 * The formatting pattern to apply.
2668 * @param locale
2669 * The locale to use.
2670 * @return The formatted bytes using the default pattern.
2672 @NonNull
2673 public static String formatAsZettabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2674 @NonNull final Locale locale) {
2675 return formatAsZettabyte(numberOfBytes, asFormat(pattern, locale));
2679 * @param numberOfBytes
2680 * The amount of bytes to format.
2681 * @param format
2682 * The formatting pattern to apply.
2683 * @return The formatted bytes using the default pattern.
2685 @NonNull
2686 public static String formatAsZettabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2687 return formatAsZettabyte(numberOfBytes.longValue(), format);
2691 * @param numberOfBytes
2692 * The amount of bytes to format.
2693 * @param format
2694 * The formatting pattern to apply.
2695 * @return The formatted bytes using the default pattern.
2697 @NonNull
2698 public static String formatAsZettabyte(final long numberOfBytes, @NonNull final Format format) {
2699 return formatAsZettabyte(asBigInteger(numberOfBytes), format);
2703 * @param numberOfBytes
2704 * The amount of bytes to format.
2705 * @param format
2706 * The formatting pattern to apply.
2707 * @return The formatted bytes using the default pattern.
2709 @NonNull
2710 public static String formatAsZettabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2711 return Zettabyte.valueOf(numberOfBytes).toString(format);
2715 * @param numberOfBytes
2716 * The amount of bytes to format.
2717 * @return The formatted bytes using the default pattern.
2719 @NonNull
2720 public static String formatAsYottabyte(@NonNull final Long numberOfBytes) {
2721 return formatAsYottabyte(numberOfBytes.longValue());
2725 * @param numberOfBytes
2726 * The amount of bytes to format.
2727 * @return The formatted bytes using the default pattern.
2729 @NonNull
2730 public static String formatAsYottabyte(final long numberOfBytes) {
2731 return formatAsYottabyte(asBigInteger(numberOfBytes));
2735 * @param numberOfBytes
2736 * The amount of bytes to format.
2737 * @return The formatted bytes using the default pattern.
2739 @NonNull
2740 public static String formatAsYottabyte(@NonNull final BigInteger numberOfBytes) {
2741 return formatAsYottabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2745 * @param numberOfBytes
2746 * The amount of bytes to format.
2747 * @param pattern
2748 * The formatting pattern to apply.
2749 * @return The formatted bytes using the default pattern.
2751 @NonNull
2752 public static String formatAsYottabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2753 return formatAsYottabyte(numberOfBytes.longValue(), pattern);
2757 * @param numberOfBytes
2758 * The amount of bytes to format.
2759 * @param pattern
2760 * The formatting pattern to apply.
2761 * @return The formatted bytes using the default pattern.
2763 @NonNull
2764 public static String formatAsYottabyte(final long numberOfBytes, @NonNull final String pattern) {
2765 return formatAsYottabyte(asBigInteger(numberOfBytes), pattern);
2769 * @param numberOfBytes
2770 * The amount of bytes to format.
2771 * @param pattern
2772 * The formatting pattern to apply.
2773 * @param locale
2774 * The locale to use.
2775 * @return The formatted bytes using the default pattern.
2777 @NonNull
2778 public static String formatAsYottabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2779 @NonNull final Locale locale) {
2780 return formatAsYottabyte(numberOfBytes, asFormat(pattern, locale));
2784 * @param numberOfBytes
2785 * The amount of bytes to format.
2786 * @param pattern
2787 * The formatting pattern to apply.
2788 * @param locale
2789 * The locale to use.
2790 * @return The formatted bytes using the default pattern.
2792 @NonNull
2793 public static String formatAsYottabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2794 @NonNull final Locale locale) {
2795 return formatAsYottabyte(numberOfBytes.longValue(), pattern, locale);
2799 * @param numberOfBytes
2800 * The amount of bytes to format.
2801 * @param pattern
2802 * The formatting pattern to apply.
2803 * @param locale
2804 * The locale to use.
2805 * @return The formatted bytes using the default pattern.
2807 @NonNull
2808 public static String formatAsYottabyte(final long numberOfBytes, @NonNull final String pattern,
2809 @NonNull final Locale locale) {
2810 return formatAsYottabyte(asBigInteger(numberOfBytes), pattern, locale);
2814 * @param numberOfBytes
2815 * The amount of bytes to format.
2816 * @param pattern
2817 * The formatting pattern to apply.
2818 * @return The formatted bytes using the default pattern.
2820 @NonNull
2821 public static String formatAsYottabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2822 return formatAsYottabyte(numberOfBytes, new DecimalFormat(pattern));
2826 * @param numberOfBytes
2827 * The amount of bytes to format.
2828 * @param format
2829 * The formatting pattern to apply.
2830 * @return The formatted bytes using the default pattern.
2832 @NonNull
2833 public static String formatAsYottabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2834 return formatAsYottabyte(numberOfBytes.longValue(), format);
2838 * @param numberOfBytes
2839 * The amount of bytes to format.
2840 * @param format
2841 * The formatting pattern to apply.
2842 * @return The formatted bytes using the default pattern.
2844 @NonNull
2845 public static String formatAsYottabyte(final long numberOfBytes, @NonNull final Format format) {
2846 return formatAsYottabyte(asBigInteger(numberOfBytes), format);
2850 * @param numberOfBytes
2851 * The amount of bytes to format.
2852 * @param format
2853 * The formatting pattern to apply.
2854 * @return The formatted bytes using the default pattern.
2856 @NonNull
2857 public static String formatAsYottabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
2858 return Yottabyte.valueOf(numberOfBytes).toString(format);
2862 * @param numberOfBytes
2863 * The amount of bytes to format.
2864 * @return The formatted bytes using the default pattern.
2866 @NonNull
2867 public static String formatAsCommonUnit(@NonNull final Long numberOfBytes) {
2868 return formatAsCommonUnit(numberOfBytes.longValue());
2872 * @param numberOfBytes
2873 * The amount of bytes to format.
2874 * @return The formatted bytes using the default pattern.
2876 @NonNull
2877 public static String formatAsCommonUnit(final long numberOfBytes) {
2878 return formatAsCommonUnit(asBigInteger(numberOfBytes));
2882 * @param numberOfBytes
2883 * The amount of bytes to format.
2884 * @return The formatted bytes using the default pattern.
2886 @NonNull
2887 public static String formatAsCommonUnit(@NonNull final BigInteger numberOfBytes) {
2888 return formatAsCommonUnit(numberOfBytes, DEFAULT_FORMAT_PATTERN);
2892 * @param numberOfBytes
2893 * The amount of bytes to format.
2894 * @param pattern
2895 * The formatting pattern to apply.
2896 * @return The formatted bytes using the default pattern.
2898 @NonNull
2899 public static String formatAsCommonUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
2900 return formatAsCommonUnit(numberOfBytes.longValue(), pattern);
2904 * @param numberOfBytes
2905 * The amount of bytes to format.
2906 * @param pattern
2907 * The formatting pattern to apply.
2908 * @return The formatted bytes using the default pattern.
2910 @NonNull
2911 public static String formatAsCommonUnit(final long numberOfBytes, @NonNull final String pattern) {
2912 return formatAsCommonUnit(asBigInteger(numberOfBytes), pattern);
2916 * @param numberOfBytes
2917 * The amount of bytes to format.
2918 * @param pattern
2919 * The formatting pattern to apply.
2920 * @return The formatted bytes using the default pattern.
2922 @NonNull
2923 public static String formatAsCommonUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
2924 return formatAsCommonUnit(numberOfBytes, new DecimalFormat(pattern));
2928 * @param numberOfBytes
2929 * The amount of bytes to format.
2930 * @param pattern
2931 * The formatting pattern to apply.
2932 * @param locale
2933 * The locale to use.
2934 * @return The formatted bytes using the default pattern.
2936 @NonNull
2937 public static String formatAsCommonUnit(@NonNull final Long numberOfBytes, @NonNull final String pattern,
2938 @NonNull final Locale locale) {
2939 return formatAsCommonUnit(numberOfBytes.longValue(), pattern, locale);
2943 * @param numberOfBytes
2944 * The amount of bytes to format.
2945 * @param pattern
2946 * The formatting pattern to apply.
2947 * @param locale
2948 * The locale to use.
2949 * @return The formatted bytes using the default pattern.
2951 @NonNull
2952 public static String formatAsCommonUnit(final long numberOfBytes, @NonNull final String pattern,
2953 @NonNull final Locale locale) {
2954 return formatAsCommonUnit(asBigInteger(numberOfBytes), pattern, locale);
2958 * @param numberOfBytes
2959 * The amount of bytes to format.
2960 * @param pattern
2961 * The formatting pattern to apply.
2962 * @param locale
2963 * The locale to use.
2964 * @return The formatted bytes using the default pattern.
2966 @NonNull
2967 public static String formatAsCommonUnit(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
2968 @NonNull final Locale locale) {
2969 return formatAsCommonUnit(numberOfBytes, asFormat(pattern, locale));
2973 * @param numberOfBytes
2974 * The amount of bytes to format.
2975 * @param format
2976 * The formatting pattern to apply.
2977 * @return The formatted bytes using the default pattern.
2979 @NonNull
2980 public static String formatAsCommonUnit(@NonNull final Long numberOfBytes, @NonNull final Format format) {
2981 return formatAsCommonUnit(numberOfBytes.longValue(), format);
2985 * @param numberOfBytes
2986 * The amount of bytes to format.
2987 * @param format
2988 * The formatting pattern to apply.
2989 * @return The formatted bytes using the default pattern.
2991 @NonNull
2992 public static String formatAsCommonUnit(final long numberOfBytes, @NonNull final Format format) {
2993 return formatAsCommonUnit(asBigInteger(numberOfBytes), format);
2997 * @param numberOfBytes
2998 * The amount of bytes to format.
2999 * @param format
3000 * The formatting pattern to apply.
3001 * @return The formatted bytes using the default pattern.
3003 @NonNull
3004 public static String formatAsCommonUnit(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3005 return commonValueOf(numberOfBytes).toString(format);
3009 * @param numberOfBytes
3010 * The amount of bytes to format.
3011 * @return The formatted bytes using the default pattern.
3013 @NonNull
3014 public static String formatAsCommonKilobyte(@NonNull final Long numberOfBytes) {
3015 return formatAsCommonKilobyte(numberOfBytes.longValue());
3019 * @param numberOfBytes
3020 * The amount of bytes to format.
3021 * @return The formatted bytes using the default pattern.
3023 @NonNull
3024 public static String formatAsCommonKilobyte(final long numberOfBytes) {
3025 return formatAsCommonKilobyte(asBigInteger(numberOfBytes));
3029 * @param numberOfBytes
3030 * The amount of bytes to format.
3031 * @return The formatted bytes using the default pattern.
3033 @NonNull
3034 public static String formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes) {
3035 return formatAsCommonKilobyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3039 * @param numberOfBytes
3040 * The amount of bytes to format.
3041 * @param pattern
3042 * The formatting pattern to apply.
3043 * @return The formatted bytes using the default pattern.
3045 @NonNull
3046 public static String formatAsCommonKilobyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3047 return formatAsCommonKilobyte(numberOfBytes.longValue(), pattern);
3051 * @param numberOfBytes
3052 * The amount of bytes to format.
3053 * @param pattern
3054 * The formatting pattern to apply.
3055 * @return The formatted bytes using the default pattern.
3057 @NonNull
3058 public static String formatAsCommonKilobyte(final long numberOfBytes, @NonNull final String pattern) {
3059 return formatAsCommonKilobyte(asBigInteger(numberOfBytes), pattern);
3063 * @param numberOfBytes
3064 * The amount of bytes to format.
3065 * @param pattern
3066 * The formatting pattern to apply.
3067 * @return The formatted bytes using the default pattern.
3069 @NonNull
3070 public static String formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes,
3071 @NonNull final String pattern) {
3072 return formatAsCommonKilobyte(numberOfBytes, new DecimalFormat(pattern));
3076 * @param numberOfBytes
3077 * The amount of bytes to format.
3078 * @param pattern
3079 * The formatting pattern to apply.
3080 * @param locale
3081 * The locale to use.
3082 * @return The formatted bytes using the default pattern.
3084 @NonNull
3085 public static String formatAsCommonKilobyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3086 @NonNull final Locale locale) {
3087 return formatAsCommonKilobyte(numberOfBytes.longValue(), pattern, locale);
3091 * @param numberOfBytes
3092 * The amount of bytes to format.
3093 * @param pattern
3094 * The formatting pattern to apply.
3095 * @param locale
3096 * The locale to use.
3097 * @return The formatted bytes using the default pattern.
3099 @NonNull
3100 public static String formatAsCommonKilobyte(final long numberOfBytes, @NonNull final String pattern,
3101 @NonNull final Locale locale) {
3102 return formatAsCommonKilobyte(asBigInteger(numberOfBytes), pattern, locale);
3106 * @param numberOfBytes
3107 * The amount of bytes to format.
3108 * @param pattern
3109 * The formatting pattern to apply.
3110 * @param locale
3111 * The locale to use.
3112 * @return The formatted bytes using the default pattern.
3114 @NonNull
3115 public static String formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3116 @NonNull final Locale locale) {
3117 return formatAsCommonKilobyte(numberOfBytes, asFormat(pattern, locale));
3121 * @param numberOfBytes
3122 * The amount of bytes to format.
3123 * @param format
3124 * The formatting pattern to apply.
3125 * @return The formatted bytes using the default pattern.
3127 @NonNull
3128 public static String formatAsCommonKilobyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3129 return formatAsCommonKilobyte(numberOfBytes.longValue(), format);
3133 * @param numberOfBytes
3134 * The amount of bytes to format.
3135 * @param format
3136 * The formatting pattern to apply.
3137 * @return The formatted bytes using the default pattern.
3139 @NonNull
3140 public static String formatAsCommonKilobyte(final long numberOfBytes, @NonNull final Format format) {
3141 return formatAsCommonKilobyte(asBigInteger(numberOfBytes), format);
3145 * @param numberOfBytes
3146 * The amount of bytes to format.
3147 * @param format
3148 * The formatting pattern to apply.
3149 * @return The formatted bytes using the default pattern.
3151 @NonNull
3152 public static String formatAsCommonKilobyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3153 return CommonKilobyte.valueOf(numberOfBytes).toString(format);
3157 * @param numberOfBytes
3158 * The amount of bytes to format.
3159 * @return The formatted bytes using the default pattern.
3161 @NonNull
3162 public static String formatAsCommonMegabyte(@NonNull final Long numberOfBytes) {
3163 return formatAsCommonMegabyte(numberOfBytes.longValue());
3167 * @param numberOfBytes
3168 * The amount of bytes to format.
3169 * @return The formatted bytes using the default pattern.
3171 @NonNull
3172 public static String formatAsCommonMegabyte(final long numberOfBytes) {
3173 return formatAsCommonMegabyte(asBigInteger(numberOfBytes));
3177 * @param numberOfBytes
3178 * The amount of bytes to format.
3179 * @return The formatted bytes using the default pattern.
3181 @NonNull
3182 public static String formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes) {
3183 return formatAsCommonMegabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3187 * @param numberOfBytes
3188 * The amount of bytes to format.
3189 * @param pattern
3190 * The formatting pattern to apply.
3191 * @return The formatted bytes using the default pattern.
3193 @NonNull
3194 public static String formatAsCommonMegabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3195 return formatAsCommonMegabyte(numberOfBytes.longValue(), pattern);
3199 * @param numberOfBytes
3200 * The amount of bytes to format.
3201 * @param pattern
3202 * The formatting pattern to apply.
3203 * @return The formatted bytes using the default pattern.
3205 @NonNull
3206 public static String formatAsCommonMegabyte(final long numberOfBytes, @NonNull final String pattern) {
3207 return formatAsCommonMegabyte(asBigInteger(numberOfBytes), pattern);
3211 * @param numberOfBytes
3212 * The amount of bytes to format.
3213 * @param pattern
3214 * The formatting pattern to apply.
3215 * @return The formatted bytes using the default pattern.
3217 @NonNull
3218 public static String formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes,
3219 @NonNull final String pattern) {
3220 return formatAsCommonMegabyte(numberOfBytes, new DecimalFormat(pattern));
3224 * @param numberOfBytes
3225 * The amount of bytes to format.
3226 * @param pattern
3227 * The formatting pattern to apply.
3228 * @param locale
3229 * The locale to use.
3230 * @return The formatted bytes using the default pattern.
3232 @NonNull
3233 public static String formatAsCommonMegabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3234 @NonNull final Locale locale) {
3235 return formatAsCommonMegabyte(numberOfBytes.longValue(), pattern, locale);
3239 * @param numberOfBytes
3240 * The amount of bytes to format.
3241 * @param pattern
3242 * The formatting pattern to apply.
3243 * @param locale
3244 * The locale to use.
3245 * @return The formatted bytes using the default pattern.
3247 @NonNull
3248 public static String formatAsCommonMegabyte(final long numberOfBytes, @NonNull final String pattern,
3249 @NonNull final Locale locale) {
3250 return formatAsCommonMegabyte(asBigInteger(numberOfBytes), pattern, locale);
3254 * @param numberOfBytes
3255 * The amount of bytes to format.
3256 * @param pattern
3257 * The formatting pattern to apply.
3258 * @param locale
3259 * The locale to use.
3260 * @return The formatted bytes using the default pattern.
3262 @NonNull
3263 public static String formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3264 @NonNull final Locale locale) {
3265 return formatAsCommonMegabyte(numberOfBytes, asFormat(pattern, locale));
3269 * @param numberOfBytes
3270 * The amount of bytes to format.
3271 * @param format
3272 * The formatting pattern to apply.
3273 * @return The formatted bytes using the default pattern.
3275 @NonNull
3276 public static String formatAsCommonMegabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3277 return formatAsCommonMegabyte(numberOfBytes.longValue(), format);
3281 * @param numberOfBytes
3282 * The amount of bytes to format.
3283 * @param format
3284 * The formatting pattern to apply.
3285 * @return The formatted bytes using the default pattern.
3287 @NonNull
3288 public static String formatAsCommonMegabyte(final long numberOfBytes, @NonNull final Format format) {
3289 return formatAsCommonMegabyte(asBigInteger(numberOfBytes), format);
3293 * @param numberOfBytes
3294 * The amount of bytes to format.
3295 * @param format
3296 * The formatting pattern to apply.
3297 * @return The formatted bytes using the default pattern.
3299 @NonNull
3300 public static String formatAsCommonMegabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3301 return CommonMegabyte.valueOf(numberOfBytes).toString(format);
3305 * @param numberOfBytes
3306 * The amount of bytes to format.
3307 * @return The formatted bytes using the default pattern.
3309 @NonNull
3310 public static String formatAsCommonGigabyte(@NonNull final Long numberOfBytes) {
3311 return formatAsCommonGigabyte(numberOfBytes.longValue());
3315 * @param numberOfBytes
3316 * The amount of bytes to format.
3317 * @return The formatted bytes using the default pattern.
3319 @NonNull
3320 public static String formatAsCommonGigabyte(final long numberOfBytes) {
3321 return formatAsCommonGigabyte(asBigInteger(numberOfBytes));
3325 * @param numberOfBytes
3326 * The amount of bytes to format.
3327 * @return The formatted bytes using the default pattern.
3329 @NonNull
3330 public static String formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes) {
3331 return formatAsCommonGigabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3335 * @param numberOfBytes
3336 * The amount of bytes to format.
3337 * @param pattern
3338 * The formatting pattern to apply.
3339 * @return The formatted bytes using the default pattern.
3341 @NonNull
3342 public static String formatAsCommonGigabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3343 return formatAsCommonGigabyte(numberOfBytes.longValue(), pattern);
3347 * @param numberOfBytes
3348 * The amount of bytes to format.
3349 * @param pattern
3350 * The formatting pattern to apply.
3351 * @return The formatted bytes using the default pattern.
3353 @NonNull
3354 public static String formatAsCommonGigabyte(final long numberOfBytes, @NonNull final String pattern) {
3355 return formatAsCommonGigabyte(asBigInteger(numberOfBytes), pattern);
3359 * @param numberOfBytes
3360 * The amount of bytes to format.
3361 * @param pattern
3362 * The formatting pattern to apply.
3363 * @return The formatted bytes using the default pattern.
3365 @NonNull
3366 public static String formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes,
3367 @NonNull final String pattern) {
3368 return formatAsCommonGigabyte(numberOfBytes, new DecimalFormat(pattern));
3372 * @param numberOfBytes
3373 * The amount of bytes to format.
3374 * @param pattern
3375 * The formatting pattern to apply.
3376 * @param locale
3377 * The locale to use.
3378 * @return The formatted bytes using the default pattern.
3380 @NonNull
3381 public static String formatAsCommonGigabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3382 @NonNull final Locale locale) {
3383 return formatAsCommonGigabyte(numberOfBytes.longValue(), pattern, locale);
3387 * @param numberOfBytes
3388 * The amount of bytes to format.
3389 * @param pattern
3390 * The formatting pattern to apply.
3391 * @param locale
3392 * The locale to use.
3393 * @return The formatted bytes using the default pattern.
3395 @NonNull
3396 public static String formatAsCommonGigabyte(final long numberOfBytes, @NonNull final String pattern,
3397 @NonNull final Locale locale) {
3398 return formatAsCommonGigabyte(asBigInteger(numberOfBytes), pattern, locale);
3402 * @param numberOfBytes
3403 * The amount of bytes to format.
3404 * @param pattern
3405 * The formatting pattern to apply.
3406 * @param locale
3407 * The locale to use.
3408 * @return The formatted bytes using the default pattern.
3410 @NonNull
3411 public static String formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3412 @NonNull final Locale locale) {
3413 return formatAsCommonGigabyte(numberOfBytes, asFormat(pattern, locale));
3417 * @param numberOfBytes
3418 * The amount of bytes to format.
3419 * @param format
3420 * The formatting pattern to apply.
3421 * @return The formatted bytes using the default pattern.
3423 @NonNull
3424 public static String formatAsCommonGigabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3425 return formatAsCommonGigabyte(numberOfBytes.longValue(), format);
3429 * @param numberOfBytes
3430 * The amount of bytes to format.
3431 * @param format
3432 * The formatting pattern to apply.
3433 * @return The formatted bytes using the default pattern.
3435 @NonNull
3436 public static String formatAsCommonGigabyte(final long numberOfBytes, @NonNull final Format format) {
3437 return formatAsCommonGigabyte(asBigInteger(numberOfBytes), format);
3441 * @param numberOfBytes
3442 * The amount of bytes to format.
3443 * @param format
3444 * The formatting pattern to apply.
3445 * @return The formatted bytes using the default pattern.
3447 @NonNull
3448 public static String formatAsCommonGigabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3449 return CommonGigabyte.valueOf(numberOfBytes).toString(format);
3453 * @param numberOfBytes
3454 * The amount of bytes to format.
3455 * @return The formatted bytes using the default pattern.
3457 @NonNull
3458 public static String formatAsCommonTerabyte(@NonNull final Long numberOfBytes) {
3459 return formatAsCommonTerabyte(numberOfBytes.longValue());
3463 * @param numberOfBytes
3464 * The amount of bytes to format.
3465 * @return The formatted bytes using the default pattern.
3467 @NonNull
3468 public static String formatAsCommonTerabyte(final long numberOfBytes) {
3469 return formatAsCommonTerabyte(asBigInteger(numberOfBytes));
3473 * @param numberOfBytes
3474 * The amount of bytes to format.
3475 * @return The formatted bytes using the default pattern.
3477 @NonNull
3478 public static String formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes) {
3479 return formatAsCommonTerabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3483 * @param numberOfBytes
3484 * The amount of bytes to format.
3485 * @param pattern
3486 * The formatting pattern to apply.
3487 * @return The formatted bytes using the default pattern.
3489 @NonNull
3490 public static String formatAsCommonTerabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3491 return formatAsCommonTerabyte(numberOfBytes.longValue(), pattern);
3495 * @param numberOfBytes
3496 * The amount of bytes to format.
3497 * @param pattern
3498 * The formatting pattern to apply.
3499 * @return The formatted bytes using the default pattern.
3501 @NonNull
3502 public static String formatAsCommonTerabyte(final long numberOfBytes, @NonNull final String pattern) {
3503 return formatAsCommonTerabyte(asBigInteger(numberOfBytes), pattern);
3507 * @param numberOfBytes
3508 * The amount of bytes to format.
3509 * @param pattern
3510 * The formatting pattern to apply.
3511 * @return The formatted bytes using the default pattern.
3513 @NonNull
3514 public static String formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes,
3515 @NonNull final String pattern) {
3516 return formatAsCommonTerabyte(numberOfBytes, new DecimalFormat(pattern));
3520 * @param numberOfBytes
3521 * The amount of bytes to format.
3522 * @param pattern
3523 * The formatting pattern to apply.
3524 * @param locale
3525 * The locale to use.
3526 * @return The formatted bytes using the default pattern.
3528 @NonNull
3529 public static String formatAsCommonTerabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3530 @NonNull final Locale locale) {
3531 return formatAsCommonTerabyte(numberOfBytes.longValue(), pattern, locale);
3535 * @param numberOfBytes
3536 * The amount of bytes to format.
3537 * @param pattern
3538 * The formatting pattern to apply.
3539 * @param locale
3540 * The locale to use.
3541 * @return The formatted bytes using the default pattern.
3543 @NonNull
3544 public static String formatAsCommonTerabyte(final long numberOfBytes, @NonNull final String pattern,
3545 @NonNull final Locale locale) {
3546 return formatAsCommonTerabyte(asBigInteger(numberOfBytes), pattern, locale);
3550 * @param numberOfBytes
3551 * The amount of bytes to format.
3552 * @param pattern
3553 * The formatting pattern to apply.
3554 * @param locale
3555 * The locale to use.
3556 * @return The formatted bytes using the default pattern.
3558 @NonNull
3559 public static String formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3560 @NonNull final Locale locale) {
3561 return formatAsCommonTerabyte(numberOfBytes, asFormat(pattern, locale));
3565 * @param numberOfBytes
3566 * The amount of bytes to format.
3567 * @param format
3568 * The formatting pattern to apply.
3569 * @return The formatted bytes using the default pattern.
3571 @NonNull
3572 public static String formatAsCommonTerabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3573 return formatAsCommonTerabyte(numberOfBytes.longValue(), format);
3577 * @param numberOfBytes
3578 * The amount of bytes to format.
3579 * @param format
3580 * The formatting pattern to apply.
3581 * @return The formatted bytes using the default pattern.
3583 @NonNull
3584 public static String formatAsCommonTerabyte(final long numberOfBytes, @NonNull final Format format) {
3585 return formatAsCommonTerabyte(asBigInteger(numberOfBytes), format);
3589 * @param numberOfBytes
3590 * The amount of bytes to format.
3591 * @param format
3592 * The formatting pattern to apply.
3593 * @return The formatted bytes using the default pattern.
3595 @NonNull
3596 public static String formatAsCommonTerabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3597 return CommonTerabyte.valueOf(numberOfBytes).toString(format);
3601 * @param numberOfBytes
3602 * The amount of bytes to format.
3603 * @return The formatted bytes using the default pattern.
3605 @NonNull
3606 public static String formatAsCommonPetabyte(@NonNull final Long numberOfBytes) {
3607 return formatAsCommonPetabyte(numberOfBytes.longValue());
3611 * @param numberOfBytes
3612 * The amount of bytes to format.
3613 * @return The formatted bytes using the default pattern.
3615 @NonNull
3616 public static String formatAsCommonPetabyte(final long numberOfBytes) {
3617 return formatAsCommonPetabyte(asBigInteger(numberOfBytes));
3621 * @param numberOfBytes
3622 * The amount of bytes to format.
3623 * @return The formatted bytes using the default pattern.
3625 @NonNull
3626 public static String formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes) {
3627 return formatAsCommonPetabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3631 * @param numberOfBytes
3632 * The amount of bytes to format.
3633 * @param pattern
3634 * The formatting pattern to apply.
3635 * @return The formatted bytes using the default pattern.
3637 @NonNull
3638 public static String formatAsCommonPetabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3639 return formatAsCommonPetabyte(numberOfBytes.longValue(), pattern);
3643 * @param numberOfBytes
3644 * The amount of bytes to format.
3645 * @param pattern
3646 * The formatting pattern to apply.
3647 * @return The formatted bytes using the default pattern.
3649 @NonNull
3650 public static String formatAsCommonPetabyte(final long numberOfBytes, @NonNull final String pattern) {
3651 return formatAsCommonPetabyte(asBigInteger(numberOfBytes), pattern);
3655 * @param numberOfBytes
3656 * The amount of bytes to format.
3657 * @param pattern
3658 * The formatting pattern to apply.
3659 * @return The formatted bytes using the default pattern.
3661 @NonNull
3662 public static String formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes,
3663 @NonNull final String pattern) {
3664 return formatAsCommonPetabyte(numberOfBytes, new DecimalFormat(pattern));
3668 * @param numberOfBytes
3669 * The amount of bytes to format.
3670 * @param pattern
3671 * The formatting pattern to apply.
3672 * @param locale
3673 * The locale to use.
3674 * @return The formatted bytes using the default pattern.
3676 @NonNull
3677 public static String formatAsCommonPetabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3678 @NonNull final Locale locale) {
3679 return formatAsCommonPetabyte(numberOfBytes.longValue(), pattern, locale);
3683 * @param numberOfBytes
3684 * The amount of bytes to format.
3685 * @param pattern
3686 * The formatting pattern to apply.
3687 * @param locale
3688 * The locale to use.
3689 * @return The formatted bytes using the default pattern.
3691 @NonNull
3692 public static String formatAsCommonPetabyte(final long numberOfBytes, @NonNull final String pattern,
3693 @NonNull final Locale locale) {
3694 return formatAsCommonPetabyte(asBigInteger(numberOfBytes), pattern, locale);
3698 * @param numberOfBytes
3699 * The amount of bytes to format.
3700 * @param pattern
3701 * The formatting pattern to apply.
3702 * @param locale
3703 * The locale to use.
3704 * @return The formatted bytes using the default pattern.
3706 @NonNull
3707 public static String formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3708 @NonNull final Locale locale) {
3709 return formatAsCommonPetabyte(numberOfBytes, asFormat(pattern, locale));
3713 * @param numberOfBytes
3714 * The amount of bytes to format.
3715 * @param format
3716 * The formatting pattern to apply.
3717 * @return The formatted bytes using the default pattern.
3719 @NonNull
3720 public static String formatAsCommonPetabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3721 return formatAsCommonPetabyte(numberOfBytes.longValue(), format);
3725 * @param numberOfBytes
3726 * The amount of bytes to format.
3727 * @param format
3728 * The formatting pattern to apply.
3729 * @return The formatted bytes using the default pattern.
3731 @NonNull
3732 public static String formatAsCommonPetabyte(final long numberOfBytes, @NonNull final Format format) {
3733 return formatAsCommonPetabyte(asBigInteger(numberOfBytes), format);
3737 * @param numberOfBytes
3738 * The amount of bytes to format.
3739 * @param format
3740 * The formatting pattern to apply.
3741 * @return The formatted bytes using the default pattern.
3743 @NonNull
3744 public static String formatAsCommonPetabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3745 return CommonPetabyte.valueOf(numberOfBytes).toString(format);
3749 * @param numberOfBytes
3750 * The amount of bytes to format.
3751 * @return The formatted bytes using the default pattern.
3753 @NonNull
3754 public static String formatAsCommonExabyte(@NonNull final Long numberOfBytes) {
3755 return formatAsCommonExabyte(numberOfBytes.longValue());
3759 * @param numberOfBytes
3760 * The amount of bytes to format.
3761 * @return The formatted bytes using the default pattern.
3763 @NonNull
3764 public static String formatAsCommonExabyte(final long numberOfBytes) {
3765 return formatAsCommonExabyte(asBigInteger(numberOfBytes));
3769 * @param numberOfBytes
3770 * The amount of bytes to format.
3771 * @return The formatted bytes using the default pattern.
3773 @NonNull
3774 public static String formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes) {
3775 return formatAsCommonExabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3779 * @param numberOfBytes
3780 * The amount of bytes to format.
3781 * @param pattern
3782 * The formatting pattern to apply.
3783 * @return The formatted bytes using the default pattern.
3785 @NonNull
3786 public static String formatAsCommonExabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3787 return formatAsCommonExabyte(numberOfBytes.longValue(), pattern);
3791 * @param numberOfBytes
3792 * The amount of bytes to format.
3793 * @param pattern
3794 * The formatting pattern to apply.
3795 * @return The formatted bytes using the default pattern.
3797 @NonNull
3798 public static String formatAsCommonExabyte(final long numberOfBytes, @NonNull final String pattern) {
3799 return formatAsCommonExabyte(asBigInteger(numberOfBytes), pattern);
3803 * @param numberOfBytes
3804 * The amount of bytes to format.
3805 * @param pattern
3806 * The formatting pattern to apply.
3807 * @return The formatted bytes using the default pattern.
3809 @NonNull
3810 public static String formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern) {
3811 return formatAsCommonExabyte(numberOfBytes, new DecimalFormat(pattern));
3815 * @param numberOfBytes
3816 * The amount of bytes to format.
3817 * @param pattern
3818 * The formatting pattern to apply.
3819 * @param locale
3820 * The locale to use.
3821 * @return The formatted bytes using the default pattern.
3823 @NonNull
3824 public static String formatAsCommonExabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3825 @NonNull final Locale locale) {
3826 return formatAsCommonExabyte(numberOfBytes.longValue(), pattern, locale);
3830 * @param numberOfBytes
3831 * The amount of bytes to format.
3832 * @param pattern
3833 * The formatting pattern to apply.
3834 * @param locale
3835 * The locale to use.
3836 * @return The formatted bytes using the default pattern.
3838 @NonNull
3839 public static String formatAsCommonExabyte(final long numberOfBytes, @NonNull final String pattern,
3840 @NonNull final Locale locale) {
3841 return formatAsCommonExabyte(asBigInteger(numberOfBytes), pattern, locale);
3845 * @param numberOfBytes
3846 * The amount of bytes to format.
3847 * @param pattern
3848 * The formatting pattern to apply.
3849 * @param locale
3850 * The locale to use.
3851 * @return The formatted bytes using the default pattern.
3853 @NonNull
3854 public static String formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
3855 @NonNull final Locale locale) {
3856 return formatAsCommonExabyte(numberOfBytes, asFormat(pattern, locale));
3860 * @param numberOfBytes
3861 * The amount of bytes to format.
3862 * @param format
3863 * The formatting pattern to apply.
3864 * @return The formatted bytes using the default pattern.
3866 @NonNull
3867 public static String formatAsCommonExabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
3868 return formatAsCommonExabyte(numberOfBytes.longValue(), format);
3872 * @param numberOfBytes
3873 * The amount of bytes to format.
3874 * @param format
3875 * The formatting pattern to apply.
3876 * @return The formatted bytes using the default pattern.
3878 @NonNull
3879 public static String formatAsCommonExabyte(final long numberOfBytes, @NonNull final Format format) {
3880 return formatAsCommonExabyte(asBigInteger(numberOfBytes), format);
3884 * @param numberOfBytes
3885 * The amount of bytes to format.
3886 * @param format
3887 * The formatting pattern to apply.
3888 * @return The formatted bytes using the default pattern.
3890 @NonNull
3891 public static String formatAsCommonExabyte(@NonNull final BigInteger numberOfBytes, @NonNull final Format format) {
3892 return CommonExabyte.valueOf(numberOfBytes).toString(format);
3896 * @param numberOfBytes
3897 * The amount of bytes to format.
3898 * @return The formatted bytes using the default pattern.
3900 @NonNull
3901 public static String formatAsCommonZettabyte(@NonNull final Long numberOfBytes) {
3902 return formatAsCommonZettabyte(numberOfBytes.longValue());
3906 * @param numberOfBytes
3907 * The amount of bytes to format.
3908 * @return The formatted bytes using the default pattern.
3910 @NonNull
3911 public static String formatAsCommonZettabyte(final long numberOfBytes) {
3912 return formatAsCommonZettabyte(asBigInteger(numberOfBytes));
3916 * @param numberOfBytes
3917 * The amount of bytes to format.
3918 * @return The formatted bytes using the default pattern.
3920 @NonNull
3921 public static String formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes) {
3922 return formatAsCommonZettabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
3926 * @param numberOfBytes
3927 * The amount of bytes to format.
3928 * @param pattern
3929 * The formatting pattern to apply.
3930 * @return The formatted bytes using the default pattern.
3932 @NonNull
3933 public static String formatAsCommonZettabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
3934 return formatAsCommonZettabyte(numberOfBytes.longValue(), pattern);
3938 * @param numberOfBytes
3939 * The amount of bytes to format.
3940 * @param pattern
3941 * The formatting pattern to apply.
3942 * @return The formatted bytes using the default pattern.
3944 @NonNull
3945 public static String formatAsCommonZettabyte(final long numberOfBytes, @NonNull final String pattern) {
3946 return formatAsCommonZettabyte(asBigInteger(numberOfBytes), pattern);
3950 * @param numberOfBytes
3951 * The amount of bytes to format.
3952 * @param pattern
3953 * The formatting pattern to apply.
3954 * @return The formatted bytes using the default pattern.
3956 @NonNull
3957 public static String formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes,
3958 @NonNull final String pattern) {
3959 return formatAsCommonZettabyte(numberOfBytes, new DecimalFormat(pattern));
3963 * @param numberOfBytes
3964 * The amount of bytes to format.
3965 * @param pattern
3966 * The formatting pattern to apply.
3967 * @param locale
3968 * The locale to use.
3969 * @return The formatted bytes using the default pattern.
3971 @NonNull
3972 public static String formatAsCommonZettabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
3973 @NonNull final Locale locale) {
3974 return formatAsCommonZettabyte(numberOfBytes.longValue(), pattern, locale);
3978 * @param numberOfBytes
3979 * The amount of bytes to format.
3980 * @param pattern
3981 * The formatting pattern to apply.
3982 * @param locale
3983 * The locale to use.
3984 * @return The formatted bytes using the default pattern.
3986 @NonNull
3987 public static String formatAsCommonZettabyte(final long numberOfBytes, @NonNull final String pattern,
3988 @NonNull final Locale locale) {
3989 return formatAsCommonZettabyte(asBigInteger(numberOfBytes), pattern, locale);
3993 * @param numberOfBytes
3994 * The amount of bytes to format.
3995 * @param pattern
3996 * The formatting pattern to apply.
3997 * @param locale
3998 * The locale to use.
3999 * @return The formatted bytes using the default pattern.
4001 @NonNull
4002 public static String formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
4003 @NonNull final Locale locale) {
4004 return formatAsCommonZettabyte(numberOfBytes, asFormat(pattern, locale));
4008 * @param numberOfBytes
4009 * The amount of bytes to format.
4010 * @param format
4011 * The formatting pattern to apply.
4012 * @return The formatted bytes using the default pattern.
4014 @NonNull
4015 public static String formatAsCommonZettabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
4016 return formatAsCommonZettabyte(numberOfBytes.longValue(), format);
4020 * @param numberOfBytes
4021 * The amount of bytes to format.
4022 * @param format
4023 * The formatting pattern to apply.
4024 * @return The formatted bytes using the default pattern.
4026 @NonNull
4027 public static String formatAsCommonZettabyte(final long numberOfBytes, @NonNull final Format format) {
4028 return formatAsCommonZettabyte(asBigInteger(numberOfBytes), format);
4032 * @param numberOfBytes
4033 * The amount of bytes to format.
4034 * @param format
4035 * The formatting pattern to apply.
4036 * @return The formatted bytes using the default pattern.
4038 @NonNull
4039 public static String formatAsCommonZettabyte(@NonNull final BigInteger numberOfBytes,
4040 @NonNull final Format format) {
4041 return CommonZettabyte.valueOf(numberOfBytes).toString(format);
4045 * @param numberOfBytes
4046 * The amount of bytes to format.
4047 * @return The formatted bytes using the default pattern.
4049 @NonNull
4050 public static String formatAsCommonYottabyte(@NonNull final Long numberOfBytes) {
4051 return formatAsCommonYottabyte(numberOfBytes.longValue());
4055 * @param numberOfBytes
4056 * The amount of bytes to format.
4057 * @return The formatted bytes using the default pattern.
4059 @NonNull
4060 public static String formatAsCommonYottabyte(final long numberOfBytes) {
4061 return formatAsCommonYottabyte(asBigInteger(numberOfBytes));
4065 * @param numberOfBytes
4066 * The amount of bytes to format.
4067 * @return The formatted bytes using the default pattern.
4069 @NonNull
4070 public static String formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes) {
4071 return formatAsCommonYottabyte(numberOfBytes, DEFAULT_FORMAT_PATTERN);
4075 * @param numberOfBytes
4076 * The amount of bytes to format.
4077 * @param pattern
4078 * The formatting pattern to apply.
4079 * @return The formatted bytes using the default pattern.
4081 @NonNull
4082 public static String formatAsCommonYottabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern) {
4083 return formatAsCommonYottabyte(numberOfBytes.longValue(), pattern);
4087 * @param numberOfBytes
4088 * The amount of bytes to format.
4089 * @param pattern
4090 * The formatting pattern to apply.
4091 * @return The formatted bytes using the default pattern.
4093 @NonNull
4094 public static String formatAsCommonYottabyte(final long numberOfBytes, @NonNull final String pattern) {
4095 return formatAsCommonYottabyte(asBigInteger(numberOfBytes), pattern);
4099 * @param numberOfBytes
4100 * The amount of bytes to format.
4101 * @param pattern
4102 * The formatting pattern to apply.
4103 * @param locale
4104 * The locale to use.
4105 * @return The formatted bytes using the default pattern.
4107 @NonNull
4108 public static String formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes, @NonNull final String pattern,
4109 @NonNull final Locale locale) {
4110 return formatAsCommonYottabyte(numberOfBytes, asFormat(pattern, locale));
4114 * @param numberOfBytes
4115 * The amount of bytes to format.
4116 * @param pattern
4117 * The formatting pattern to apply.
4118 * @param locale
4119 * The locale to use.
4120 * @return The formatted bytes using the default pattern.
4122 @NonNull
4123 public static String formatAsCommonYottabyte(@NonNull final Long numberOfBytes, @NonNull final String pattern,
4124 @NonNull final Locale locale) {
4125 return formatAsCommonYottabyte(numberOfBytes.longValue(), pattern, locale);
4129 * @param numberOfBytes
4130 * The amount of bytes to format.
4131 * @param pattern
4132 * The formatting pattern to apply.
4133 * @param locale
4134 * The locale to use.
4135 * @return The formatted bytes using the default pattern.
4137 @NonNull
4138 public static String formatAsCommonYottabyte(final long numberOfBytes, @NonNull final String pattern,
4139 @NonNull final Locale locale) {
4140 return formatAsCommonYottabyte(asBigInteger(numberOfBytes), pattern, locale);
4144 * @param numberOfBytes
4145 * The amount of bytes to format.
4146 * @param pattern
4147 * The formatting pattern to apply.
4148 * @return The formatted bytes using the default pattern.
4150 @NonNull
4151 public static String formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes,
4152 @NonNull final String pattern) {
4153 return formatAsCommonYottabyte(numberOfBytes, new DecimalFormat(pattern));
4157 * @param numberOfBytes
4158 * The amount of bytes to format.
4159 * @param format
4160 * The formatting pattern to apply.
4161 * @return The formatted bytes using the default pattern.
4163 @NonNull
4164 public static String formatAsCommonYottabyte(@NonNull final Long numberOfBytes, @NonNull final Format format) {
4165 return formatAsCommonYottabyte(numberOfBytes.longValue(), format);
4169 * @param numberOfBytes
4170 * The amount of bytes to format.
4171 * @param format
4172 * The formatting pattern to apply.
4173 * @return The formatted bytes using the default pattern.
4175 @NonNull
4176 public static String formatAsCommonYottabyte(final long numberOfBytes, @NonNull final Format format) {
4177 return formatAsCommonYottabyte(asBigInteger(numberOfBytes), format);
4181 * @param numberOfBytes
4182 * The amount of bytes to format.
4183 * @param format
4184 * The formatting pattern to apply.
4185 * @return The formatted bytes using the default pattern.
4187 @NonNull
4188 public static String formatAsCommonYottabyte(@NonNull final BigInteger numberOfBytes,
4189 @NonNull final Format format) {
4190 return CommonYottabyte.valueOf(numberOfBytes).toString(format);
4194 * @param numberOfBytes
4195 * The amount of bytes to create.
4196 * @return A new unit representing the given amount of bytes.
4198 @NonNull
4199 public static Byte bytes(@NonNull final Long numberOfBytes) {
4200 return bytes(numberOfBytes.longValue());
4204 * @param numberOfBytes
4205 * The amount of bytes to create.
4206 * @return A new unit representing the given amount of bytes.
4208 @NonNull
4209 public static Byte bytes(final long numberOfBytes) {
4210 return bytes(asBigInteger(numberOfBytes));
4214 * @param numberOfBytes
4215 * The amount of bytes to create.
4216 * @return A new unit representing the given amount of bytes.
4218 @NonNull
4219 public static Byte bytes(@NonNull final BigInteger numberOfBytes) {
4220 return new Byte(numberOfBytes);
4224 * @param numberOfKibibytes
4225 * The amount of kibibytes to create.
4226 * @return A new unit representing the given amount of kibibytes.
4228 @NonNull
4229 public static Kibibyte kibibyte(@NonNull final Long numberOfKibibytes) {
4230 return kibibyte(numberOfKibibytes.longValue());
4234 * @param numberOfKibibytes
4235 * The amount of kibibytes to create.
4236 * @return A new unit representing the given amount of kibibytes.
4238 @NonNull
4239 public static Kibibyte kibibyte(final long numberOfKibibytes) {
4240 return kibibyte(asBigInteger(numberOfKibibytes));
4244 * @param numberOfKibibytes
4245 * The amount of kibibytes to create.
4246 * @return A new unit representing the given amount of kibibytes.
4248 @NonNull
4249 public static Kibibyte kibibyte(@NonNull final BigInteger numberOfKibibytes) {
4250 return new Kibibyte(multiplyNullsafe(BYTES_IN_A_KIBIBYTE, numberOfKibibytes));
4254 * @param numberOfMebibytes
4255 * The amount of mebibytes to create.
4256 * @return A new unit representing the given amount of mebibytes.
4258 @NonNull
4259 public static Mebibyte mebibyte(@NonNull final Long numberOfMebibytes) {
4260 return mebibyte(numberOfMebibytes.longValue());
4264 * @param numberOfMebibytes
4265 * The amount of mebibytes to create.
4266 * @return A new unit representing the given amount of mebibytes.
4268 @NonNull
4269 public static Mebibyte mebibyte(final long numberOfMebibytes) {
4270 return mebibyte(asBigInteger(numberOfMebibytes));
4274 * @param numberOfMebibytes
4275 * The amount of mebibytes to create.
4276 * @return A new unit representing the given amount of mebibytes.
4278 @NonNull
4279 public static Mebibyte mebibyte(@NonNull final BigInteger numberOfMebibytes) {
4280 return new Mebibyte(multiplyNullsafe(BYTES_IN_A_MEBIBYTE, numberOfMebibytes));
4284 * @param numberOfGibibytes
4285 * The amount of gibibytes to create.
4286 * @return A new unit representing the given amount of gibibytes.
4288 @NonNull
4289 public static Gibibyte gibibyte(@NonNull final Long numberOfGibibytes) {
4290 return gibibyte(numberOfGibibytes.longValue());
4294 * @param numberOfGibibytes
4295 * The amount of gibibytes to create.
4296 * @return A new unit representing the given amount of gibibytes.
4298 @NonNull
4299 public static Gibibyte gibibyte(final long numberOfGibibytes) {
4300 return gibibyte(asBigInteger(numberOfGibibytes));
4304 * @param numberOfGibibytes
4305 * The amount of gibibytes to create.
4306 * @return A new unit representing the given amount of gibibytes.
4308 @NonNull
4309 public static Gibibyte gibibyte(@NonNull final BigInteger numberOfGibibytes) {
4310 return new Gibibyte(multiplyNullsafe(BYTES_IN_A_GIBIBYTE, numberOfGibibytes));
4314 * @param numberOfTebibytes
4315 * The amount of tebibytes to create.
4316 * @return A new unit representing the given amount of tebibytes.
4318 @NonNull
4319 public static Tebibyte tebibyte(@NonNull final Long numberOfTebibytes) {
4320 return tebibyte(numberOfTebibytes.longValue());
4324 * @param numberOfTebibytes
4325 * The amount of tebibytes to create.
4326 * @return A new unit representing the given amount of tebibytes.
4328 @NonNull
4329 public static Tebibyte tebibyte(final long numberOfTebibytes) {
4330 return tebibyte(asBigInteger(numberOfTebibytes));
4334 * @param numberOfTebibytes
4335 * The amount of tebibytes to create.
4336 * @return A new unit representing the given amount of tebibytes.
4338 @NonNull
4339 public static Tebibyte tebibyte(@NonNull final BigInteger numberOfTebibytes) {
4340 return new Tebibyte(multiplyNullsafe(BYTES_IN_A_TEBIBYTE, numberOfTebibytes));
4344 * @param numberOfPebibytes
4345 * The amount of pebibytes to create.
4346 * @return A new unit representing the given amount of pebibytes.
4348 @NonNull
4349 public static Pebibyte pebibyte(@NonNull final Long numberOfPebibytes) {
4350 return pebibyte(numberOfPebibytes.longValue());
4354 * @param numberOfPebibytes
4355 * The amount of pebibytes to create.
4356 * @return A new unit representing the given amount of pebibytes.
4358 @NonNull
4359 public static Pebibyte pebibyte(final long numberOfPebibytes) {
4360 return pebibyte(asBigInteger(numberOfPebibytes));
4364 * @param numberOfPebibytes
4365 * The amount of pebibytes to create.
4366 * @return A new unit representing the given amount of pebibytes.
4368 @NonNull
4369 public static Pebibyte pebibyte(@NonNull final BigInteger numberOfPebibytes) {
4370 return new Pebibyte(multiplyNullsafe(BYTES_IN_A_PEBIBYTE, numberOfPebibytes));
4374 * @param numberOfExbibytes
4375 * The amount of exbibytes to create.
4376 * @return A new unit representing the given amount of exbibytes.
4378 @NonNull
4379 public static Exbibyte exbibyte(@NonNull final Long numberOfExbibytes) {
4380 return exbibyte(numberOfExbibytes.longValue());
4384 * @param numberOfExbibytes
4385 * The amount of exbibytes to create.
4386 * @return A new unit representing the given amount of exbibytes.
4388 @NonNull
4389 public static Exbibyte exbibyte(final long numberOfExbibytes) {
4390 return exbibyte(asBigInteger(numberOfExbibytes));
4394 * @param numberOfExbibytes
4395 * The amount of exbibytes to create.
4396 * @return A new unit representing the given amount of exbibytes.
4398 @NonNull
4399 public static Exbibyte exbibyte(@NonNull final BigInteger numberOfExbibytes) {
4400 return new Exbibyte(multiplyNullsafe(BYTES_IN_A_EXBIBYTE, numberOfExbibytes));
4404 * @param numberOfZebibytes
4405 * The amount of zebibytes to create.
4406 * @return A new unit representing the given amount of zebibytes.
4408 @NonNull
4409 public static Zebibyte zebibyte(@NonNull final Long numberOfZebibytes) {
4410 return zebibyte(numberOfZebibytes.longValue());
4414 * @param numberOfZebibytes
4415 * The amount of zebibytes to create.
4416 * @return A new unit representing the given amount of zebibytes.
4418 @NonNull
4419 public static Zebibyte zebibyte(final long numberOfZebibytes) {
4420 return zebibyte(asBigInteger(numberOfZebibytes));
4424 * @param numberOfZebibytes
4425 * The amount of zebibytes to create.
4426 * @return A new unit representing the given amount of zebibytes.
4428 @NonNull
4429 public static Zebibyte zebibyte(@NonNull final BigInteger numberOfZebibytes) {
4430 return new Zebibyte(multiplyNullsafe(BYTES_IN_A_ZEBIBYTE, numberOfZebibytes));
4434 * @param numberOfYobibytes
4435 * The amount of yobibytes to create.
4436 * @return A new unit representing the given amount of yobibytes.
4438 @NonNull
4439 public static Yobibyte yobibyte(@NonNull final Long numberOfYobibytes) {
4440 return yobibyte(numberOfYobibytes.longValue());
4444 * @param numberOfYobibytes
4445 * The amount of yobibytes to create.
4446 * @return A new unit representing the given amount of yobibytes.
4448 @NonNull
4449 public static Yobibyte yobibyte(final long numberOfYobibytes) {
4450 return yobibyte(asBigInteger(numberOfYobibytes));
4454 * @param numberOfYobibytes
4455 * The amount of yobibytes to create.
4456 * @return A new unit representing the given amount of yobibytes.
4458 @NonNull
4459 public static Yobibyte yobibyte(@NonNull final BigInteger numberOfYobibytes) {
4460 return new Yobibyte(multiplyNullsafe(BYTES_IN_A_YOBIBYTE, numberOfYobibytes));
4464 * @param numberOfKilobytes
4465 * The number of kilobytes to create.
4466 * @return A new unit representing the given amount of kilobytes.
4468 @NonNull
4469 public static Kilobyte kilobyte(@NonNull final Long numberOfKilobytes) {
4470 return kilobyte(numberOfKilobytes.longValue());
4474 * @param numberOfKilobytes
4475 * The number of kilobytes to create.
4476 * @return A new unit representing the given amount of kilobytes.
4478 @NonNull
4479 public static Kilobyte kilobyte(final long numberOfKilobytes) {
4480 return kilobyte(asBigInteger(numberOfKilobytes));
4484 * @param numberOfKilobytes
4485 * The number of kilobytes to create.
4486 * @return A new unit representing the given amount of kilobytes.
4488 @NonNull
4489 public static Kilobyte kilobyte(@NonNull final BigInteger numberOfKilobytes) {
4490 return new Kilobyte(multiplyNullsafe(BYTES_IN_A_KILOBYTE, numberOfKilobytes));
4494 * @param numberOfMegabytes
4495 * The number of megabytes to create.
4496 * @return A new unit representing the given amount of megabytes.
4498 @NonNull
4499 public static Megabyte megabyte(@NonNull final Long numberOfMegabytes) {
4500 return megabyte(numberOfMegabytes.longValue());
4504 * @param numberOfMegabytes
4505 * The number of megabytes to create.
4506 * @return A new unit representing the given amount of megabytes.
4508 @NonNull
4509 public static Megabyte megabyte(final long numberOfMegabytes) {
4510 return megabyte(asBigInteger(numberOfMegabytes));
4514 * @param numberOfMegabytes
4515 * The number of megabytes to create.
4516 * @return A new unit representing the given amount of megabytes.
4518 @NonNull
4519 public static Megabyte megabyte(@NonNull final BigInteger numberOfMegabytes) {
4520 return new Megabyte(multiplyNullsafe(BYTES_IN_A_MEGABYTE, numberOfMegabytes));
4524 * @param numberOfGigabytes
4525 * The number of gigabytes to create.
4526 * @return A new unit representing the given amount of gigabytes.
4528 @NonNull
4529 public static Gigabyte gigabyte(@NonNull final Long numberOfGigabytes) {
4530 return gigabyte(numberOfGigabytes.longValue());
4534 * @param numberOfGigabytes
4535 * The number of gigabytes to create.
4536 * @return A new unit representing the given amount of gigabytes.
4538 @NonNull
4539 public static Gigabyte gigabyte(final long numberOfGigabytes) {
4540 return gigabyte(asBigInteger(numberOfGigabytes));
4544 * @param numberOfGigabytes
4545 * The number of gigabytes to create.
4546 * @return A new unit representing the given amount of gigabytes.
4548 @NonNull
4549 public static Gigabyte gigabyte(@NonNull final BigInteger numberOfGigabytes) {
4550 return new Gigabyte(multiplyNullsafe(BYTES_IN_A_GIGABYTE, numberOfGigabytes));
4554 * @param numberOfTerabytes
4555 * The number of terabytes to create.
4556 * @return A new unit representing the given amount of terabytes.
4558 @NonNull
4559 public static Terabyte terabyte(@NonNull final Long numberOfTerabytes) {
4560 return terabyte(numberOfTerabytes.longValue());
4564 * @param numberOfTerabytes
4565 * The number of terabytes to create.
4566 * @return A new unit representing the given amount of terabytes.
4568 @NonNull
4569 public static Terabyte terabyte(final long numberOfTerabytes) {
4570 return terabyte(asBigInteger(numberOfTerabytes));
4574 * @param numberOfTerabytes
4575 * The number of terabytes to create.
4576 * @return A new unit representing the given amount of terabytes.
4578 @NonNull
4579 public static Terabyte terabyte(@NonNull final BigInteger numberOfTerabytes) {
4580 return new Terabyte(multiplyNullsafe(BYTES_IN_A_TERABYTE, numberOfTerabytes));
4584 * @param numberOfPetabytes
4585 * The number of petabytes to create.
4586 * @return A new unit representing the given amount of petabytes.
4588 @NonNull
4589 public static Petabyte petabyte(@NonNull final Long numberOfPetabytes) {
4590 return petabyte(numberOfPetabytes.longValue());
4594 * @param numberOfPetabytes
4595 * The number of petabytes to create.
4596 * @return A new unit representing the given amount of petabytes.
4598 @NonNull
4599 public static Petabyte petabyte(final long numberOfPetabytes) {
4600 return petabyte(asBigInteger(numberOfPetabytes));
4604 * @param numberOfPetabytes
4605 * The number of petabytes to create.
4606 * @return A new unit representing the given amount of petabytes.
4608 @NonNull
4609 public static Petabyte petabyte(@NonNull final BigInteger numberOfPetabytes) {
4610 return new Petabyte(multiplyNullsafe(BYTES_IN_A_PETABYTE, numberOfPetabytes));
4614 * @param numberOfExabytes
4615 * The number of exabytes to create.
4616 * @return A new unit representing the given amount of exabytes.
4618 @NonNull
4619 public static Exabyte exabyte(@NonNull final Long numberOfExabytes) {
4620 return exabyte(numberOfExabytes.longValue());
4624 * @param numberOfExabytes
4625 * The number of exabytes to create.
4626 * @return A new unit representing the given amount of exabytes.
4628 @NonNull
4629 public static Exabyte exabyte(final long numberOfExabytes) {
4630 return exabyte(asBigInteger(numberOfExabytes));
4634 * @param numberOfExabytes
4635 * The number of exabytes to create.
4636 * @return A new unit representing the given amount of exabytes.
4638 @NonNull
4639 public static Exabyte exabyte(@NonNull final BigInteger numberOfExabytes) {
4640 return new Exabyte(multiplyNullsafe(BYTES_IN_A_EXABYTE, numberOfExabytes));
4644 * @param numberOfZettabytes
4645 * The number of zettabytes to create.
4646 * @return A new unit representing the given amount of zettabytes.
4648 @NonNull
4649 public static Zettabyte zettabyte(@NonNull final Long numberOfZettabytes) {
4650 return zettabyte(numberOfZettabytes.longValue());
4654 * @param numberOfZettabytes
4655 * The number of zettabytes to create.
4656 * @return A new unit representing the given amount of zettabytes.
4658 @NonNull
4659 public static Zettabyte zettabyte(final long numberOfZettabytes) {
4660 return zettabyte(asBigInteger(numberOfZettabytes));
4664 * @param numberOfZettabytes
4665 * The number of zettabytes to create.
4666 * @return A new unit representing the given amount of zettabytes.
4668 @NonNull
4669 public static Zettabyte zettabyte(@NonNull final BigInteger numberOfZettabytes) {
4670 return new Zettabyte(multiplyNullsafe(BYTES_IN_A_ZETTABYTE, numberOfZettabytes));
4674 * @param numberOfYottabytes
4675 * The number of yottabytes to create.
4676 * @return A new unit representing the given amount of yottabytes.
4678 @NonNull
4679 public static Yottabyte yottabyte(@NonNull final Long numberOfYottabytes) {
4680 return yottabyte(numberOfYottabytes.longValue());
4684 * @param numberOfYottabytes
4685 * The number of yottabytes to create.
4686 * @return A new unit representing the given amount of yottabytes.
4688 @NonNull
4689 public static Yottabyte yottabyte(final long numberOfYottabytes) {
4690 return yottabyte(asBigInteger(numberOfYottabytes));
4694 * @param numberOfYottabytes
4695 * The number of yottabytes to create.
4696 * @return A new unit representing the given amount of yottabytes.
4698 @NonNull
4699 public static Yottabyte yottabyte(@NonNull final BigInteger numberOfYottabytes) {
4700 return new Yottabyte(multiplyNullsafe(BYTES_IN_A_YOTTABYTE, numberOfYottabytes));
4704 * @param numberOfKilobytes
4705 * The number of kilobytes to create.
4706 * @return A new unit representing the given amount of kilobytes.
4708 @NonNull
4709 public static CommonKilobyte commonKilobyte(@NonNull final Long numberOfKilobytes) {
4710 return commonKilobyte(numberOfKilobytes.longValue());
4714 * @param numberOfKilobytes
4715 * The number of kilobytes to create.
4716 * @return A new unit representing the given amount of kilobytes.
4718 @NonNull
4719 public static CommonKilobyte commonKilobyte(final long numberOfKilobytes) {
4720 return commonKilobyte(asBigInteger(numberOfKilobytes));
4724 * @param numberOfKilobytes
4725 * The number of kilobytes to create.
4726 * @return A new unit representing the given amount of kilobytes.
4728 @NonNull
4729 public static CommonKilobyte commonKilobyte(@NonNull final BigInteger numberOfKilobytes) {
4730 return new CommonKilobyte(multiplyNullsafe(BYTES_IN_A_KIBIBYTE, numberOfKilobytes));
4734 * @param numberOfMegabytes
4735 * The number of megabytes to create.
4736 * @return A new unit representing the given amount of megabytes.
4738 @NonNull
4739 public static CommonMegabyte commonMegabyte(@NonNull final Long numberOfMegabytes) {
4740 return commonMegabyte(numberOfMegabytes.longValue());
4744 * @param numberOfMegabytes
4745 * The number of megabytes to create.
4746 * @return A new unit representing the given amount of megabytes.
4748 @NonNull
4749 public static CommonMegabyte commonMegabyte(final long numberOfMegabytes) {
4750 return commonMegabyte(asBigInteger(numberOfMegabytes));
4754 * @param numberOfMegabytes
4755 * The number of megabytes to create.
4756 * @return A new unit representing the given amount of megabytes.
4758 @NonNull
4759 public static CommonMegabyte commonMegabyte(@NonNull final BigInteger numberOfMegabytes) {
4760 return new CommonMegabyte(multiplyNullsafe(BYTES_IN_A_MEBIBYTE, numberOfMegabytes));
4764 * @param numberOfGigabytes
4765 * The number of gigabytes to create.
4766 * @return A new unit representing the given amount of gigabytes.
4768 @NonNull
4769 public static CommonGigabyte commonGigabyte(@NonNull final Long numberOfGigabytes) {
4770 return commonGigabyte(numberOfGigabytes.longValue());
4774 * @param numberOfGigabytes
4775 * The number of gigabytes to create.
4776 * @return A new unit representing the given amount of gigabytes.
4778 @NonNull
4779 public static CommonGigabyte commonGigabyte(final long numberOfGigabytes) {
4780 return commonGigabyte(asBigInteger(numberOfGigabytes));
4784 * @param numberOfGigabytes
4785 * The number of gigabytes to create.
4786 * @return A new unit representing the given amount of gigabytes.
4788 @NonNull
4789 public static CommonGigabyte commonGigabyte(@NonNull final BigInteger numberOfGigabytes) {
4790 return new CommonGigabyte(multiplyNullsafe(BYTES_IN_A_GIBIBYTE, numberOfGigabytes));
4794 * @param numberOfTerabytes
4795 * The number of terabytes to create.
4796 * @return A new unit representing the given amount of terabytes.
4798 @NonNull
4799 public static CommonTerabyte commonTerabyte(@NonNull final Long numberOfTerabytes) {
4800 return commonTerabyte(numberOfTerabytes.longValue());
4804 * @param numberOfTerabytes
4805 * The number of terabytes to create.
4806 * @return A new unit representing the given amount of terabytes.
4808 @NonNull
4809 public static CommonTerabyte commonTerabyte(final long numberOfTerabytes) {
4810 return commonTerabyte(asBigInteger(numberOfTerabytes));
4814 * @param numberOfTerabytes
4815 * The number of terabytes to create.
4816 * @return A new unit representing the given amount of terabytes.
4818 @NonNull
4819 public static CommonTerabyte commonTerabyte(@NonNull final BigInteger numberOfTerabytes) {
4820 return new CommonTerabyte(multiplyNullsafe(BYTES_IN_A_TEBIBYTE, numberOfTerabytes));
4824 * @param numberOfPetabytes
4825 * The number of petabytes to create.
4826 * @return A new unit representing the given amount of petabytes.
4828 @NonNull
4829 public static CommonPetabyte commonPetabyte(@NonNull final Long numberOfPetabytes) {
4830 return commonPetabyte(numberOfPetabytes.longValue());
4834 * @param numberOfPetabytes
4835 * The number of petabytes to create.
4836 * @return A new unit representing the given amount of petabytes.
4838 @NonNull
4839 public static CommonPetabyte commonPetabyte(final long numberOfPetabytes) {
4840 return commonPetabyte(asBigInteger(numberOfPetabytes));
4844 * @param numberOfPetabytes
4845 * The number of petabytes to create.
4846 * @return A new unit representing the given amount of petabytes.
4848 @NonNull
4849 public static CommonPetabyte commonPetabyte(@NonNull final BigInteger numberOfPetabytes) {
4850 return new CommonPetabyte(multiplyNullsafe(BYTES_IN_A_PEBIBYTE, numberOfPetabytes));
4854 * @param numberOfExabytes
4855 * The number of exabytes to create.
4856 * @return A new unit representing the given amount of exabytes.
4858 @NonNull
4859 public static CommonExabyte commonExabyte(@NonNull final Long numberOfExabytes) {
4860 return commonExabyte(numberOfExabytes.longValue());
4864 * @param numberOfExabytes
4865 * The number of exabytes to create.
4866 * @return A new unit representing the given amount of exabytes.
4868 @NonNull
4869 public static CommonExabyte commonExabyte(final long numberOfExabytes) {
4870 return commonExabyte(asBigInteger(numberOfExabytes));
4874 * @param numberOfExabytes
4875 * The number of exabytes to create.
4876 * @return A new unit representing the given amount of exabytes.
4878 @NonNull
4879 public static CommonExabyte commonExabyte(@NonNull final BigInteger numberOfExabytes) {
4880 return new CommonExabyte(multiplyNullsafe(BYTES_IN_A_EXBIBYTE, numberOfExabytes));
4884 * @param numberOfZettabytes
4885 * The number of zettabytes to create.
4886 * @return A new unit representing the given amount of zettabytes.
4888 @NonNull
4889 public static CommonZettabyte commonZettabyte(@NonNull final Long numberOfZettabytes) {
4890 return commonZettabyte(numberOfZettabytes.longValue());
4894 * @param numberOfZettabytes
4895 * The number of zettabytes to create.
4896 * @return A new unit representing the given amount of zettabytes.
4898 @NonNull
4899 public static CommonZettabyte commonZettabyte(final long numberOfZettabytes) {
4900 return commonZettabyte(asBigInteger(numberOfZettabytes));
4904 * @param numberOfZettabytes
4905 * The number of zettabytes to create.
4906 * @return A new unit representing the given amount of zettabytes.
4908 @NonNull
4909 public static CommonZettabyte commonZettabyte(@NonNull final BigInteger numberOfZettabytes) {
4910 return new CommonZettabyte(multiplyNullsafe(BYTES_IN_A_ZEBIBYTE, numberOfZettabytes));
4914 * @param numberOfYottabytes
4915 * The number of yottabytes to create.
4916 * @return A new unit representing the given amount of yottabytes.
4918 @NonNull
4919 public static CommonYottabyte commonYottabyte(@NonNull final Long numberOfYottabytes) {
4920 return commonYottabyte(numberOfYottabytes.longValue());
4924 * @param numberOfYottabytes
4925 * The number of yottabytes to create.
4926 * @return A new unit representing the given amount of yottabytes.
4928 @NonNull
4929 public static CommonYottabyte commonYottabyte(final long numberOfYottabytes) {
4930 return commonYottabyte(asBigInteger(numberOfYottabytes));
4934 * @param numberOfYottabytes
4935 * The number of yottabytes to create.
4936 * @return A new unit representing the given amount of yottabytes.
4938 @NonNull
4939 public static CommonYottabyte commonYottabyte(@NonNull final BigInteger numberOfYottabytes) {
4940 return new CommonYottabyte(multiplyNullsafe(BYTES_IN_A_YOBIBYTE, numberOfYottabytes));