You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following in a configuration file (2 yottabytes):
bytes2=2Y
Attempting to read using getBytes returns zero and no exception is thrown:
myConfig.getBytes("bytes2")
I don't think it makes sense to support any abbreviations that result in Long overflow, yet the source code shows support for K (kilo), M (mega), G (giga), T(tera), P (peta), E (exa), Z (zetta) and Y (yotta). Most of these silently fail instead of throwing an exception like
new ArithmeticException("Long overflow");
The text was updated successfully, but these errors were encountered:
Might be good to document all of the supported conversions: K (kilo), M (mega), G (giga), T(tera), P (peta), E (exa), Z (zetta) and Y (yotta). I saw Kibi..Yobi in the code, not sure how they would be notated in a config file so that might also be a good thing to document.
How about providing a version that supports arbitrarily large numbers by returning BigInteger instead of Long? Might call it getBytesAsBigInteger. I think the practical upper limit for BigInteger is something like (2^31)-1 digits (maximum length of a String), so no problem to store a YottaByte in BigInteger.
Given the following in a configuration file (2 yottabytes):
Attempting to read using getBytes returns zero and no exception is thrown:
I don't think it makes sense to support any abbreviations that result in Long overflow, yet the source code shows support for K (kilo), M (mega), G (giga), T(tera), P (peta), E (exa), Z (zetta) and Y (yotta). Most of these silently fail instead of throwing an exception like
The text was updated successfully, but these errors were encountered: