List of usage examples for org.apache.spark.network.util JavaUtils byteStringAsBytes
public static long byteStringAsBytes(String str)
From source file:com.github.cbismuth.fdupes.cli.SystemPropertyGetter.java
License:Open Source License
public int getBufferSize() { final String property = environment.getProperty("fdupes.buffer.size", String.class, "4k"); try {/*from ww w .j a va 2 s . c o m*/ return Math.toIntExact(JavaUtils.byteStringAsBytes(property)); } catch (final NumberFormatException | ArithmeticException ignored) { LOGGER.error("Unrecognized buffer size format [{}] fallback to [{}] bytes", property, DEFAULT_BUFFER_SIZE); return DEFAULT_BUFFER_SIZE; } }