Package java.nio

Examples of java.nio.IntBuffer.rewind()


            } else {
                throw new IllegalArgumentException ( "unmapped glyph id \"" + gid + "\"" );
            }
        }
        cb.rewind();
        gb.rewind();
        return new GlyphSequence ( cb, gb, null );
    }
    public int[] getWidths ( String[] gids ) {
        assert gids != null;
        int ng = gids.length;
View Full Code Here


    }

    private static int[] getGlyphs ( GlyphSequence gs ) {
        IntBuffer gb = gs.getGlyphs();
        int[] ga = new int [ gb.limit() ];
        gb.rewind();
        gb.get ( ga );
        return ga;
    }

    private static String makeDataPathName ( String spn, int fno ) {
View Full Code Here

        }else{
            IntBuffer value = BufferUtils.createIntBuffer(length);
            for (int x = 0; x < length; x++) {
                value.put(readIntForBuffer(content));
            }
            value.rewind();
            return value;
        }
    }

    // byte buffer
View Full Code Here

            // create little endian store
            final ByteBuffer buf = ByteBuffer.allocate(array.length).order(ByteOrder.LITTLE_ENDIAN);

            // place buffer into store. Rewind buffers
            value.rewind();
            buf.asIntBuffer().put(value);
            buf.rewind();

            // Pull out store as array
            buf.get(array);
View Full Code Here

        final IndexBufferData<?> finalIndices = BufferUtils.createIndexBufferData(max, data.getVertexCount() - 1);
        data.setIndices(finalIndices);
        final int[] sectionCounts = new int[sections.size()];
        for (int i = 0; i < sectionCounts.length; i++) {
            final IntBuffer ib = sections.get(i);
            ib.rewind();
            sectionCounts[i] = ib.remaining();
            while (ib.hasRemaining()) {
                finalIndices.put(ib.get());
            }
        }
View Full Code Here

            value = BufferUtils.createIntBufferOnHeap(length);
            contentCopyRequired = true;
        }
        if (contentCopyRequired) {
            value.put(buf.asIntBuffer());
            value.rewind();
        }
        return value;
    }

    // short buffer
View Full Code Here

    }

    @Override
    public IntBuffer asIntBuffer() {
        final IntBuffer source = getBuffer().duplicate();
        source.rewind();
        final IntBuffer buff = BufferUtils.createIntBufferOnHeap(source.limit());
        buff.put(source);
        buff.flip();
        return buff;
    }
View Full Code Here

        array.setAll(IntArray.unsafeValueOf());
        assertArrayEquals(new int[]{}, array.toArray());
        assertEquals(0, array.length());
        assertEquals(offset, array.offset());
        IntBuffer buffer = array.buffer();
        buffer.rewind().limit(buffer.capacity());
        while (buffer.hasRemaining()) {
            assertEquals(0, buffer.get());
        }
    }
View Full Code Here

        }
        assertArrayEquals(new int[]{}, array.toArray());
        assertEquals(0, array.length());
        assertEquals(offset, array.offset());
        IntBuffer buffer = array.buffer();
        buffer.rewind().limit(buffer.capacity());
        while (buffer.hasRemaining()) {
            assertEquals(0, buffer.get());
        }
    }
View Full Code Here

        array.clear();
        assertArrayEquals(new int[]{}, array.toArray());
        assertEquals(0, array.length());
        assertEquals(offset, array.offset());
        IntBuffer buffer = array.buffer();
        buffer.rewind().limit(buffer.capacity());
        while (buffer.hasRemaining()) {
            assertEquals(0, buffer.get());
        }
    }
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.