Example usage for java.nio DoubleBuffer reset

List of usage examples for java.nio DoubleBuffer reset

Introduction

In this page you can find the example usage for java.nio DoubleBuffer reset.

Prototype

public final Buffer reset() 

Source Link

Document

Resets the position of this buffer to the mark.

Usage

From source file:Main.java

public static ByteBuffer copyDoubleBufferAsByteBuffer(DoubleBuffer buf) {
    ByteBuffer dest = newByteBuffer(buf.remaining() * SIZEOF_DOUBLE);
    buf.mark();/*  www .  ja  va  2s.  c  o  m*/
    dest.asDoubleBuffer().put(buf);
    buf.reset();
    dest.rewind();
    return dest;
}