Examples of capacity()


Examples of java.nio.ByteBuffer.capacity()

        if(filebuffer == null) {
            System.out.println("Error loading file: " + args[0]);
            System.exit(-1);
        }
       
        System.out.println("loaded " + filebuffer.capacity());
       
        //ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer));
        if(usingVorbis) {
          // pass directly to buffer data
          AL10.alBufferData(buffers.get(0), AL10.AL_FORMAT_VORBIS_EXT, filebuffer, -1);
View Full Code Here

Examples of java.nio.ByteBuffer.capacity()

        final MapMode mapMode = ((readwrite) ? MapMode.READ_WRITE
            : MapMode.READ_ONLY);
        buf = this.channel.map(mapMode, regional, minimum);
        buf.clear();

        block = new BufferBlock(buf, BitBuffer.wrap(buf), regional, buf.capacity());
        block.getByteBuffer().order(this.byteOrder);

        System.gc();

        break;
View Full Code Here

Examples of java.nio.ByteBuffer.capacity()

    buffer.reset();

    final int MAX_HEADER_LENGTH = 24;
    final ByteBuffer view = BufferUtils.duplicate(buffer);
    final int capacity = view.capacity();
    boolean status = true;

    for (int i = 0; i < count && view.position() + MAX_HEADER_LENGTH < capacity; i++) {
      view.mark();
      long length = headerReader.readLength(view);
View Full Code Here

Examples of java.nio.CharBuffer.capacity()

            CoderResult result = decoder.decode(inbuf, dest, true);
            dest.flip();

            if (result.isUnderflow()) { // done reading
                // make sure there is at least one extra character
                if (dest.limit() == dest.capacity()) {
                    dest = CharBuffer.allocate(dest.capacity()+1).put(dest);
                    dest.flip();
                }
                return dest;
            } else if (result.isOverflow()) { // buffer too small; expand
View Full Code Here

Examples of java.nio.DoubleBuffer.capacity()

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

Examples of java.nio.FloatBuffer.capacity()

        FloatBuffer imgPts2 = points2[1].getFloatBuffer();
        IntBuffer imgCount2 = points2[2].getIntBuffer();
        assert(imgCount1.capacity() == imgCount2.capacity());

        CvMat objectPointsMat = CvMat.create(1, Math.min(objPts1.capacity(), objPts2.capacity()), CV_32F, 3);
        CvMat imagePoints1Mat = CvMat.create(1, Math.min(imgPts1.capacity(), imgPts2.capacity()), CV_32F, 2);
        CvMat imagePoints2Mat = CvMat.create(1, Math.min(imgPts1.capacity(), imgPts2.capacity()), CV_32F, 2);
        CvMat pointCountsMat  = CvMat.create(1, imgCount1.capacity(), CV_32S, 1);
        FloatBuffer objectPoints = objectPointsMat.getFloatBuffer();
        FloatBuffer imagePoints1 = imagePoints1Mat.getFloatBuffer();
        FloatBuffer imagePoints2 = imagePoints2Mat.getFloatBuffer();
View Full Code Here

Examples of java.nio.IntBuffer.capacity()

        refreshLimits();

        //Switch to OpenGL select mode
        int capacity = 1 * 4 * leaves.getCount();      //Each object take in maximium : 4 * name stack depth
        IntBuffer hitsBuffer = BufferUtil.newIntBuffer(capacity);
        gl.glSelectBuffer(hitsBuffer.capacity(), hitsBuffer);
        gl.glRenderMode(GL.GL_SELECT);
        gl.glInitNames();
        gl.glPushName(0);
        gl.glDisable(GL.GL_CULL_FACE);      //Disable flags
        //Draw the nodes cube in the select buffer
View Full Code Here

Examples of java.nio.LongBuffer.capacity()

    }
    public void testLongBufferArgument() {
        LongBuffer buf  = LongBuffer.allocate(1024);
        final long MAGIC = 0x1234567887654321L;
        lib.fillInt64Buffer(buf, 1024, MAGIC);
        for (int i=0;i < buf.capacity();i++) {
            assertEquals("Bad value at index " + i, MAGIC, buf.get(i));
        }
    }
   
    public void testDirectByteBufferArgument() {
View Full Code Here

Examples of java.nio.MappedByteBuffer.capacity()

        // Map file
        FileInputStream fis = new FileInputStream(tmpFile);
        FileChannel fc = fis.getChannel();
        MappedByteBuffer mmb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc
                .size());
        int len = mmb.capacity();
        assertEquals("Got wrong number of bytes", 46, len); //$NON-NLS-1$

        // Read in our 26 bytes
        for (int i = 0; i < 26; i++) {
            byte b = mmb.get();
View Full Code Here

Examples of java.nio.ShortBuffer.capacity()

    }
    public void testShortBufferArgument() {
        ShortBuffer buf  = ShortBuffer.allocate(1024);
        final short MAGIC = (short)0xABED;
        lib.fillInt16Buffer(buf, 1024, MAGIC);
        for (int i=0;i < buf.capacity();i++) {
            assertEquals("Bad value at index " + i, MAGIC, buf.get(i));
        }
    }
    public void testIntBufferArgument() {
        IntBuffer buf  = IntBuffer.allocate(1024);
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.