List of usage examples for java.nio DoubleBuffer limit
public final int limit()
From source file:Main.java
public static DoubleBuffer createDoubleBuffer(DoubleBuffer buf, final int size) { if (buf != null && buf.limit() == size) { buf.rewind();/*from ww w . j a v a 2 s. c o m*/ return buf; } buf = createDoubleBuffer(size); return buf; }
From source file:Main.java
public static DoubleBuffer clone(final DoubleBuffer buf) { if (buf == null) { return null; }//from w w w. j av a 2 s . c o m buf.rewind(); final DoubleBuffer copy; if (buf.isDirect()) { copy = createDoubleBuffer(buf.limit()); } else { copy = createDoubleBufferOnHeap(buf.limit()); } copy.put(buf); return copy; }
From source file:Main.java
public static DoubleBuffer clone(final DoubleBuffer buf) { if (buf == null) { return null; }//w ww. ja va 2 s. co m buf.rewind(); final DoubleBuffer copy; if (buf.isDirect()) { copy = createDoubleBuffer(buf.limit()); } else { copy = createDoubleBufferOnHeap(buf.limit()); } copy.put(buf); return copy; }