Example usage for org.apache.spark.network.util JavaUtils byteStringAsBytes

List of usage examples for org.apache.spark.network.util JavaUtils byteStringAsBytes

Introduction

In this page you can find the example usage for org.apache.spark.network.util JavaUtils byteStringAsBytes.

Prototype

public static long byteStringAsBytes(String str) 

Source Link

Document

Convert a passed byte string (e.g.

Usage

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;
    }
}