Example usage for io.netty.buffer Unpooled copyFloat

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

Introduction

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

Prototype

public static ByteBuf copyFloat(float... values) 

Source Link

Document

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

Usage

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

License:Apache License

/**
 *
 * @param data//from  w ww .j ava2s .c om
 * @param copy
 */
public BaseDataBuffer(float[] data, boolean copy) {
    allocationMode = Nd4j.alloc;
    if (allocationMode == AllocationMode.HEAP) {
        if (copy) {
            floatData = ArrayUtil.copy(data);
        } else {
            this.floatData = data;
        }
    } else {
        dataBuffer = Unpooled.copyFloat(data).order(ByteOrder.nativeOrder());
    }
    length = data.length;

}