List of usage examples for java.nio DoubleBuffer mark
public final Buffer mark()
reset()
. From source file:Main.java
public static ByteBuffer copyDoubleBufferAsByteBuffer(DoubleBuffer buf) { ByteBuffer dest = newByteBuffer(buf.remaining() * SIZEOF_DOUBLE); buf.mark(); dest.asDoubleBuffer().put(buf);//from w w w . j a v a2 s . co m buf.reset(); dest.rewind(); return dest; }