Example usage for java.nio ByteOrder nativeOrder

List of usage examples for java.nio ByteOrder nativeOrder

Introduction

In this page you can find the example usage for java.nio ByteOrder nativeOrder.

Prototype

public static ByteOrder nativeOrder() 

Source Link

Document

Returns the current platform byte order.

Usage

From source file:com.epam.catgenome.manager.FileManager.java

/**
 * Writes list of WigSection objects to a BIGWIG file, specified by WigFile. Used for BIGWIG downsampling
 *
 * @param wigFile a WigFile to write into
 * @param wigSections a List of WigSection objects, representing BIGWIG records to write
 * @param chromSizes List of Pairs of chromosome sizes
 * @param chromosomeName a name of a chromosome, for which to write BIGWIG file
 * @throws IOException//from ww  w .  j  a  v  a 2  s . c om
 */
public void writeToBigWigFile(WigFile wigFile, List<WigSection> wigSections,
        List<kotlin.Pair<String, Integer>> chromSizes, String chromosomeName) throws IOException {
    final Map<String, Object> params = new HashMap<>();
    params.put(DIR_ID.name(), wigFile.getId());
    params.put(USER_ID.name(), wigFile.getCreatedBy());
    params.put(CHROMOSOME_NAME.name(), chromosomeName);

    File file = new File(toRealPath(substitute(WIG_FILE, params)));
    Assert.isTrue(file.createNewFile());

    BigWigFile.write(wigSections, chromSizes, file.toPath(), 0, CompressionType.DEFLATE,
            ByteOrder.nativeOrder());
}