Package java.nio

Examples of java.nio.IntBuffer.limit()


        int newOffset = offset + fromIndex;
        int newLength = toIndex - fromIndex;
        subArrayCheck(newOffset, newLength);
        IntBuffer copy = elements.duplicate();
        copy.position(newOffset);
        copy.limit(newOffset + newLength);
        return new SubBoundedIntBufferArrayImpl(this, copy);
    }

    /**
     * Tells whether or not the array's content is resident in physical memory.
View Full Code Here


  private void sendCommand(short unit_address, int cmd_data[],
      int rsp_data[], short rsp_data_size[]) throws PM3Exception {

    short ecode = 0;
    IntBuffer cmdDataBuffer = IntBuffer.wrap(cmd_data);
    short cmd_data_size = (short) cmdDataBuffer.limit();

    IntBuffer rspDataBuffer = IntBuffer.wrap(rsp_data);

    rsp_data_size[0] = RSP_DATA_SIZE;
    ShortBuffer rspDataSizeBuffer = ShortBuffer.wrap(rsp_data_size);
View Full Code Here

            return this;
        }
        int offset = elements.position();
        subArrayCheck(offset, length);
        IntBuffer copy = elements.duplicate();
        copy.limit(offset + length);
        return new IntBufferArrayImpl(copy, characteristics, false);
    }

    /**
     * Convenience method, combining {@code offset(int)} and {@code length(int)}.
View Full Code Here

            return this;
        }
        subArrayCheck(newOffset, newLength);
        IntBuffer copy = elements.duplicate();
        copy.position(newOffset);
        copy.limit(newOffset + newLength);
        return new IntBufferArrayImpl(copy, characteristics, false);
    }

    @SuppressWarnings({"MissingMethodJavaDoc", "MissingFieldJavaDoc"})
    private class ArrayIteratorImpl implements ArrayIterator.OfInt {
View Full Code Here

  private void sendCommand(short unit_address, int cmd_data[],
      int rsp_data[], short rsp_data_size[]) throws PM3Exception {

    short ecode = 0;
    IntBuffer cmdDataBuffer = IntBuffer.wrap(cmd_data);
    short cmd_data_size = (short) cmdDataBuffer.limit();

    IntBuffer rspDataBuffer = IntBuffer.wrap(rsp_data);

    rsp_data_size[0] = RSP_DATA_SIZE;
    ShortBuffer rspDataSizeBuffer = ShortBuffer.wrap(rsp_data_size);
View Full Code Here

    short unit_address = 0;
   
    int cmd_data[] = {CSAFE_SETUSERCFG1_CMD, 2, CSAFE_PM_GET_WORKTIME, CSAFE_PM_GET_WORKDISTANCE};   
    IntBuffer cmdDataBuffer = IntBuffer.wrap(cmd_data);
 
    short cmd_data_size = (short) cmdDataBuffer.limit();
     
    int rsp_data[] = new int[RSP_DATA_SIZE];
    IntBuffer rspDataBuffer = IntBuffer.wrap(rsp_data);
    short rsp_data_size[] = new short[1];
    rsp_data_size[0]= RSP_DATA_SIZE;
View Full Code Here

            return this;
        }
        int offset = elements.position();
        subArrayCheck(offset, length);
        IntBuffer copy = elements.duplicate();
        copy.limit(offset + length);
        return new SubMutableIntBufferArrayImpl(this, copy);
    }

    /**
     * Convenience method, combining {@code offset(int)} and {@code length(int)}.
View Full Code Here

            return this;
        }
        subArrayCheck(newOffset, newLength);
        IntBuffer copy = elements.duplicate();
        copy.position(newOffset);
        copy.limit(newOffset + newLength);
        return new SubMutableIntBufferArrayImpl(this, copy);
    }

    @SuppressWarnings({"MissingMethodJavaDoc", "MissingFieldJavaDoc"})
    private class ArrayIteratorImpl implements ArrayIterator.OfInt {
View Full Code Here

            }
        }

        final IntBuffer id = BufferUtils.createIntBuffer(1);
        id.clear();
        gl.glGenTextures(id.limit(), id);
        final int textureId = id.get(0);

        // store the new id by our current gl context.
        texture.setTextureIdForContext(context.getGlContextRep(), textureId);
View Full Code Here

        final IntBuffer idBuffer = BufferUtils.createIntBuffer(1);
        idBuffer.clear();
        idBuffer.put(id.intValue());
        idBuffer.rewind();
        gl.glDeleteTextures(idBuffer.limit(), idBuffer);
        record.removeTextureRecord(id);
        texture.removeFromIdCache(context.getGlContextRep());
    }

    public static void deleteTextureIds(final Collection<Integer> ids) {
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.