Package java.nio

Examples of java.nio.Buffer.position()


  private void flip(TestHarness h, BufferFactory factory)
  {
    Buffer buf = null;

    buf = factory.newInstance();
    buf.position(5);
    buf.mark();
    buf.position(6);
    h.check(buf.flip(), buf, "flip: buf.flip()");
    checkStatus(h, buf, "flip", 20, 6, true, 6, 0);
    try
View Full Code Here


    Buffer buf = null;

    buf = factory.newInstance();
    buf.position(5);
    buf.mark();
    buf.position(6);
    h.check(buf.flip(), buf, "flip: buf.flip()");
    checkStatus(h, buf, "flip", 20, 6, true, 6, 0);
    try
      {
        buf.reset();
View Full Code Here

            transfer(offset, n);
            skipInBuffer(n * dataSize);
            while ((length -= n) != 0) {
                offset += n;
                ensureBufferContains(dataSize);
                view.position(0).limit(buffer.remaining() / dataSize);
                transfer(offset, n = Math.min(view.remaining(), length));
                skipInBuffer(n * dataSize);
            }
        }
    }
View Full Code Here

    }

    @Override
    public long address(Object o) {
        Buffer buffer = (Buffer) o;
        return MemoryIO.getInstance().getDirectBufferAddress(buffer) + (buffer.position() << shift);
    }

    @Override
    public Object object(Object o) {
        return o;
View Full Code Here

    }

    @Override
    public int offset(Object o) {
        Buffer buffer = (Buffer) o;
        return buffer.arrayOffset() + buffer.position();
    }

    @Override
    public int length(Object o) {
        return ((Buffer) o).remaining();
View Full Code Here

                    if (buffer != null) {
                        buffer.rewind();
                        bulkPut(vb.getFormat(), newVerts,buffer)
                       
                        int index = vertexData.size();                     
                        newVerts.position(vertexData.size() * vb.getNumComponents());
                        for (int j = 0; j < newVertices.size(); j++) {
                            int oldInd = indiceMap.get(index) ;
                            for (int i = 0; i < vb.getNumComponents(); i++) {                               
                                    putValue(vb.getFormat(), newVerts, buffer, oldInd* vb.getNumComponents() + i);
                            }                           
View Full Code Here

            transfer(offset, n);
            skipInBuffer(n * dataSize);
            while ((length -= n) != 0) {
                offset += n;
                ensureBufferContains(dataSize);
                view.position(0).limit(buffer.remaining() / dataSize);
                transfer(offset, n = Math.min(view.remaining(), length));
                skipInBuffer(n * dataSize);
            }
        }
    }
View Full Code Here

    }

    @Override
    public int offset(Object o) {
        Buffer buffer = (Buffer) o;
        return buffer.arrayOffset() + buffer.position();
    }

    @Override
    public int length(Object o) {
        return ((Buffer) o).remaining();
View Full Code Here

    }

    @Override
    public int offset(Object o) {
        Buffer buffer = (Buffer) o;
        return buffer.arrayOffset() + buffer.position();
    }

    @Override
    public int length(Object o) {
        return ((Buffer) o).remaining();
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.