List of usage examples for java.nio DoubleBuffer remaining
public final int remaining()
From source file:Main.java
public static ByteBuffer copyDoubleBufferAsByteBuffer(DoubleBuffer buf) { ByteBuffer dest = newByteBuffer(buf.remaining() * SIZEOF_DOUBLE); buf.mark();/* w w w .ja v a 2s. c om*/ dest.asDoubleBuffer().put(buf); buf.reset(); dest.rewind(); return dest; }
From source file:ubic.basecode.io.ByteArrayConverter.java
/** * @param barray/* w w w. ja v a 2 s . com*/ * @return double[] */ public double[] byteArrayToDoubles(byte[] barray) { if (barray == null) return null; DoubleBuffer buf = ByteBuffer.wrap(barray).asDoubleBuffer(); double[] array = new double[buf.remaining()]; buf.get(array); return array; }