Example usage for io.netty.buffer Unpooled copyDouble

List of usage examples for io.netty.buffer Unpooled copyDouble

Introduction

In this page you can find the example usage for io.netty.buffer Unpooled copyDouble.

Prototype

public static ByteBuf copyDouble(double... values) 

Source Link

Document

Create a new big-endian buffer that holds a sequence of the specified 64-bit floating point numbers.

Usage

From source file:org.nd4j.linalg.api.buffer.BaseDataBuffer.java

License:Apache License

/**
 *
 * @param data// w w w  .j a v  a2s  .  co m
 * @param copy
 */
public BaseDataBuffer(double[] data, boolean copy) {
    allocationMode = Nd4j.alloc;
    if (allocationMode == AllocationMode.HEAP) {
        if (copy) {
            doubleData = ArrayUtil.copy(data);
        } else {
            this.doubleData = data;
        }
    } else {
        dataBuffer = Unpooled.copyDouble(data).order(ByteOrder.nativeOrder());
    }
    length = data.length;

}