Package java.nio

Examples of java.nio.ByteBuffer.asFloatBuffer()


        // Convert to float buffer.
        final FloatBuffer value;
        final boolean contentCopyRequired;
        if (direct) {
            if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
                value = buf.asFloatBuffer();
                contentCopyRequired = false;
            } else {
                value = BufferUtils.createFloatBuffer(length);
                contentCopyRequired = true;
            }
View Full Code Here


        } else {
            value = BufferUtils.createFloatBufferOnHeap(length);
            contentCopyRequired = true;
        }
        if (contentCopyRequired) {
            value.put(buf.asFloatBuffer());
            value.rewind();
        }

        return value;
    }
View Full Code Here

        assertTrue(b.isDirect());
        assertView("duplicate", b, b.duplicate(), 1);
        assertView("char view", b, b.asCharBuffer(), 2);
        assertView("short view", b, b.asShortBuffer(), 2);
        assertView("int view", b, b.asIntBuffer(), 4);
        assertView("float view", b, b.asFloatBuffer(), 4);
        assertView("double view", b, b.asDoubleBuffer(), 8);
        assertView("long view", b, b.asLongBuffer(), 8);
    }
}
View Full Code Here

            MyJapi.f522bb1(MyJapi.f422bb1());
            assert (nf422bb + 1 == f422bb.asLongBuffer().get());

            out.println("\ncalling f523bb1(f423bb1())");
            final ByteBuffer f423bb = MyJapi.f423bb1().order(ByteOrder.nativeOrder());
            final float nf423bb = f423bb.asFloatBuffer().get();
            MyJapi.f523bb1(f423bb);
            assert (nf423bb == f423bb.asFloatBuffer().get());
            MyJapi.f523bb1(MyJapi.f423bb1());
            assert (nf423bb + 1 == f423bb.asFloatBuffer().get());
View Full Code Here

            out.println("\ncalling f523bb1(f423bb1())");
            final ByteBuffer f423bb = MyJapi.f423bb1().order(ByteOrder.nativeOrder());
            final float nf423bb = f423bb.asFloatBuffer().get();
            MyJapi.f523bb1(f423bb);
            assert (nf423bb == f423bb.asFloatBuffer().get());
            MyJapi.f523bb1(MyJapi.f423bb1());
            assert (nf423bb + 1 == f423bb.asFloatBuffer().get());

            out.println("\ncalling f524bb1(f424bb1())");
            final ByteBuffer f424bb = MyJapi.f424bb1().order(ByteOrder.nativeOrder());
View Full Code Here

            final ByteBuffer f423bb = MyJapi.f423bb1().order(ByteOrder.nativeOrder());
            final float nf423bb = f423bb.asFloatBuffer().get();
            MyJapi.f523bb1(f423bb);
            assert (nf423bb == f423bb.asFloatBuffer().get());
            MyJapi.f523bb1(MyJapi.f423bb1());
            assert (nf423bb + 1 == f423bb.asFloatBuffer().get());

            out.println("\ncalling f524bb1(f424bb1())");
            final ByteBuffer f424bb = MyJapi.f424bb1().order(ByteOrder.nativeOrder());
            final double nf424bb = f424bb.asDoubleBuffer().get();
            MyJapi.f524bb1(f424bb);
View Full Code Here

            MyJapi.f542bb1(f442bb);
            assert (nf442bb + 1 == f442bb.asLongBuffer().get());

            out.println("\ncalling f543bb1(f443bb1())");
            final ByteBuffer f443bb = MyJapi.f443bb1().order(ByteOrder.nativeOrder());
            final float nf443bb = f443bb.asFloatBuffer().get();
            MyJapi.f543bb1(f443bb);
            assert (nf443bb + 1 == f443bb.asFloatBuffer().get());

            out.println("\ncalling f544bb1(f444bb1())");
            final ByteBuffer f444bb = MyJapi.f444bb1().order(ByteOrder.nativeOrder());
View Full Code Here

            out.println("\ncalling f543bb1(f443bb1())");
            final ByteBuffer f443bb = MyJapi.f443bb1().order(ByteOrder.nativeOrder());
            final float nf443bb = f443bb.asFloatBuffer().get();
            MyJapi.f543bb1(f443bb);
            assert (nf443bb + 1 == f443bb.asFloatBuffer().get());

            out.println("\ncalling f544bb1(f444bb1())");
            final ByteBuffer f444bb = MyJapi.f444bb1().order(ByteOrder.nativeOrder());
            final double nf444bb = f444bb.asDoubleBuffer().get();
            MyJapi.f544bb1(f444bb);
View Full Code Here

            MyJapi.f562bb1(MyJapi.f462bb1());
            assert (nf462bb + 1 == f462bb.asLongBuffer().get());

            out.println("\ncalling f563bb1(f463bb1())");
            final ByteBuffer f463bb = MyJapi.f463bb1().order(ByteOrder.nativeOrder());
            final float nf463bb = f463bb.asFloatBuffer().get();
            MyJapi.f563bb1(f463bb);
            assert (nf463bb == f463bb.asFloatBuffer().get());
            MyJapi.f563bb1(MyJapi.f463bb1());
            assert (nf463bb + 1 == f463bb.asFloatBuffer().get());
View Full Code Here

            out.println("\ncalling f563bb1(f463bb1())");
            final ByteBuffer f463bb = MyJapi.f463bb1().order(ByteOrder.nativeOrder());
            final float nf463bb = f463bb.asFloatBuffer().get();
            MyJapi.f563bb1(f463bb);
            assert (nf463bb == f463bb.asFloatBuffer().get());
            MyJapi.f563bb1(MyJapi.f463bb1());
            assert (nf463bb + 1 == f463bb.asFloatBuffer().get());

            out.println("\ncalling f564bb1(f464bb1())");
            final ByteBuffer f464bb = MyJapi.f464bb1().order(ByteOrder.nativeOrder());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.