Package java.nio

Examples of java.nio.IntBuffer.limit()


    return direct_buffer;
  }

  private static IntBuffer doNoCopyWrap(IntBuffer buffer) {
    IntBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.limit(buffer.limit());
    direct_buffer.position(buffer.position());
    return direct_buffer;
  }

  private static FloatBuffer doNoCopyWrap(FloatBuffer buffer) {
View Full Code Here


        bytesToRemove++;

        int[] codePoints;
        try {
            IntBuffer intBuffer = ByteBuffer.wrap(pathComponent.getBytes("UTF-32BE")).asIntBuffer();
            codePoints = new int[intBuffer.limit()];
            intBuffer.get(codePoints);
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
View Full Code Here

    return ((ByteArrayOutputStream) stream).toByteArray();
  }

  public final int[] toIntArray() {
    IntBuffer source = ByteBuffer.wrap(toByteArray()).asIntBuffer();
    return IntBuffer.allocate(source.limit()).put(source).array();
  }


  final class Frame {
View Full Code Here

   */
  @Override
  public double getQuick(int rowIndex, int columnIndex) {
    IntBuffer tmp = data.get(bufferIndex[rowIndex]).asReadOnlyBuffer();
    tmp.position(rowOffset[rowIndex]);
    tmp.limit(rowSize[rowIndex]);
    tmp = tmp.slice();
    return searchForIndex(tmp, columnIndex);
  }

  private static double searchForIndex(IntBuffer row, int columnIndex) {
View Full Code Here

   */
  @Override
  public Vector viewRow(int rowIndex) {
    IntBuffer tmp = data.get(bufferIndex[rowIndex]).asReadOnlyBuffer();
    tmp.position(rowOffset[rowIndex]);
    tmp.limit(rowOffset[rowIndex] + rowSize[rowIndex]);
    tmp = tmp.slice();
    return new SparseBinaryVector(tmp, columnSize());
  }

  private static class SparseBinaryVector extends AbstractVector {
View Full Code Here

        IntBuffer current = scratch;
        /**
         * gen new names
         */
        IntBuffer add = _genVRAMBuffersMap(numBuffers);
        scratch = BufferIO._newi(current.limit() + add.limit());
        /**
         * refill scratch
         */
        current.rewind();
        while (current.hasRemaining()) {
View Full Code Here

            throw new Ardor3dException("Texture is already setup and has id.");
        }

        // Create the texture
        final IntBuffer ibuf = BufferUtils.createIntBuffer(1);
        gl.glGenTextures(ibuf.limit(), ibuf); // TODO Check <size>
        final int textureId = ibuf.get(0);
        tex.setTextureIdForContext(context.getGlContextRep(), textureId);

        JoglTextureStateUtil.doTextureBind(tex, 0, true);
View Full Code Here

        if (_fboID != 0) {
            final IntBuffer id = BufferUtils.createIntBuffer(1);
            id.put(_fboID);
            id.rewind();
            gl.glDeleteFramebuffers(id.limit(), id);
        }

        if (_depthRBID != 0) {
            final IntBuffer id = BufferUtils.createIntBuffer(1);
            id.put(_depthRBID);
View Full Code Here

        if (_depthRBID != 0) {
            final IntBuffer id = BufferUtils.createIntBuffer(1);
            id.put(_depthRBID);
            id.rewind();
            gl.glDeleteRenderbuffers(id.limit(), id);
        }
    }
}
View Full Code Here

    private void assertSameGlyphs ( GlyphSequence gs1, GlyphSequence gs2 ) {
        assertNotNull ( gs1 );
        assertNotNull ( gs2 );
        IntBuffer gb1 = gs1.getGlyphs();
        IntBuffer gb2 = gs2.getGlyphs();
        assertEquals ( "unequal glyph count", gb1.limit(), gb2.limit() );
        for ( int i = 0; i < gb1.limit(); i++ ) {
            int g1 = gb1.get(i);
            int g2 = gb2.get(i);
            assertEquals ( "unequal glyph code", g1, g2 );
        }
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.