List of usage examples for java.nio ShortBuffer isDirect
public abstract boolean isDirect();
From source file:Main.java
public static void main(String[] args) { ShortBuffer bb = ShortBuffer.allocate(10); bb.put((short) 100); System.out.println(bb.isDirect()); }
From source file:Main.java
public static ShortBuffer clone(final ShortBuffer buf) { if (buf == null) { return null; }//from w ww . j a va 2s . co m buf.rewind(); final ShortBuffer copy; if (buf.isDirect()) { copy = createShortBuffer(buf.limit()); } else { copy = createShortBufferOnHeap(buf.limit()); } copy.put(buf); return copy; }