Package java.nio

Examples of java.nio.ShortBuffer.remaining()


        // test BIG_ENDIAN short buffer, read
        buf.clear();
        buf.order(ByteOrder.BIG_ENDIAN);
        shortBuffer = buf.asShortBuffer();
        assertSame(ByteOrder.BIG_ENDIAN, shortBuffer.order());
        while (shortBuffer.remaining() > 0) {
            buf.get(bytes);
            value = shortBuffer.get();
            assertEquals(bytes2short(bytes, buf.order()), value);
        }
View Full Code Here


        // test LITTLE_ENDIAN short buffer, read
        buf.clear();
        buf.order(ByteOrder.LITTLE_ENDIAN);
        shortBuffer = buf.asShortBuffer();
        assertSame(ByteOrder.LITTLE_ENDIAN, shortBuffer.order());
        while (shortBuffer.remaining() > 0) {
            buf.get(bytes);
            value = shortBuffer.get();
            assertEquals(bytes2short(bytes, buf.order()), value);
        }
View Full Code Here

            // test BIG_ENDIAN short buffer, write
            buf.clear();
            buf.order(ByteOrder.BIG_ENDIAN);
            shortBuffer = buf.asShortBuffer();
            assertSame(ByteOrder.BIG_ENDIAN, shortBuffer.order());
            while (shortBuffer.remaining() > 0) {
                value = (short) shortBuffer.remaining();
                shortBuffer.put(value);
                buf.get(bytes);
                assertTrue(Arrays.equals(bytes, short2bytes(value, buf.order())));
            }
View Full Code Here

            buf.clear();
            buf.order(ByteOrder.BIG_ENDIAN);
            shortBuffer = buf.asShortBuffer();
            assertSame(ByteOrder.BIG_ENDIAN, shortBuffer.order());
            while (shortBuffer.remaining() > 0) {
                value = (short) shortBuffer.remaining();
                shortBuffer.put(value);
                buf.get(bytes);
                assertTrue(Arrays.equals(bytes, short2bytes(value, buf.order())));
            }
View Full Code Here

            // test LITTLE_ENDIAN short buffer, write
            buf.clear();
            buf.order(ByteOrder.LITTLE_ENDIAN);
            shortBuffer = buf.asShortBuffer();
            assertSame(ByteOrder.LITTLE_ENDIAN, shortBuffer.order());
            while (shortBuffer.remaining() > 0) {
                value = (short) shortBuffer.remaining();
                shortBuffer.put(value);
                buf.get(bytes);
                assertTrue(Arrays.equals(bytes, short2bytes(value, buf.order())));
            }
View Full Code Here

            buf.clear();
            buf.order(ByteOrder.LITTLE_ENDIAN);
            shortBuffer = buf.asShortBuffer();
            assertSame(ByteOrder.LITTLE_ENDIAN, shortBuffer.order());
            while (shortBuffer.remaining() > 0) {
                value = (short) shortBuffer.remaining();
                shortBuffer.put(value);
                buf.get(bytes);
                assertTrue(Arrays.equals(bytes, short2bytes(value, buf.order())));
            }
        }
View Full Code Here

            ShortBuffer scene = sceneMD.getData().createShortBuffer();
            ShortBuffer depth = depthMD.getData().createShortBuffer();
            calcHist(depth);
            depth.rewind();
           
            while(depth.remaining() > 0)
            {
                int pos = depth.position();
                short pixel = depth.get();
                short user = scene.get();
               
View Full Code Here

           
            ShortBuffer depth = depthMD.getData().createShortBuffer();
            calcHist(depth);
            depth.rewind();
           
            while(depth.remaining() > 0)
            {
                int pos = depth.position();
                short pixel = depth.get();
                imgbytes[pos] = (byte)histogram[pixel];
            }
View Full Code Here

       
        ShortBuffer depth = depthMD.getData().createShortBuffer();
        depth.rewind();

        int points = 0;
        while(depth.remaining() > 0)
        {
            short depthVal = depth.get();
            if (depthVal != 0)
            {
                histogram[depthVal]++;
View Full Code Here

           
            calcHist(depthMD);
            ShortBuffer depth = depthMD.getData().createShortBuffer();
            depth.rewind();
           
            while(depth.remaining() > 0)
            {
                int pos = depth.position();
                short pixel = depth.get();
                imgbytes[pos] = (byte)histogram[pixel];
            }
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.