Package java.nio

Examples of java.nio.LongBuffer


        if (elements.remaining() == length) {
            return this;
        }
        int offset = elements.position();
        subArrayCheck(offset, length);
        LongBuffer copy = elements.duplicate();
        copy.limit(offset + length);
        return new LongBufferArrayImpl(copy, characteristics, false);
    }


        int newLength = toIndex - fromIndex;
        if (newOffset == offset && newLength == length) {
            return this;
        }
        subArrayCheck(newOffset, newLength);
        LongBuffer copy = elements.duplicate();
        copy.position(newOffset);
        copy.limit(newOffset + newLength);
        return new LongBufferArrayImpl(copy, characteristics, false);
    }

            return this;
        }
        int newOffset = elements.position() + offset;
        int newLength = elements.remaining() - offset;
        subArrayCheck(newOffset, newLength);
        LongBuffer copy = elements.duplicate();
        copy.position(newOffset);
        return new SubMutableLongBufferArrayImpl(this, copy);
    }

        if (elements.remaining() == length) {
            return this;
        }
        int offset = elements.position();
        subArrayCheck(offset, length);
        LongBuffer copy = elements.duplicate();
        copy.limit(offset + length);
        return new SubMutableLongBufferArrayImpl(this, copy);
    }

        int newLength = toIndex - fromIndex;
        if (newOffset == offset && newLength == length) {
            return this;
        }
        subArrayCheck(newOffset, newLength);
        LongBuffer copy = elements.duplicate();
        copy.position(newOffset);
        copy.limit(newOffset + newLength);
        return new SubMutableLongBufferArrayImpl(this, copy);
    }

    @Override
    public BoundedLongArray offset(int offset) {
        int newOffset = elements.position() + offset;
        int newLength = elements.remaining() - offset;
        subArrayCheck(newOffset, newLength);
        LongBuffer copy = elements.duplicate();
        copy.position(newOffset);
        return new SubBoundedLongBufferArrayImpl(this, copy);
    }

     */
    @Override
    public MutableLongArray length(int length) {
        int offset = elements.position();
        subArrayCheck(offset, length);
        LongBuffer copy = elements.duplicate();
        copy.limit(offset + length);
        return new SubBoundedLongBufferArrayImpl(this, copy);
    }

    public MutableLongArray subArray(int fromIndex, int toIndex) {
        int offset = elements.position();
        int newOffset = offset + fromIndex;
        int newLength = toIndex - fromIndex;
        subArrayCheck(newOffset, newLength);
        LongBuffer copy = elements.duplicate();
        copy.position(newOffset);
        copy.limit(newOffset + newLength);
        return new SubBoundedLongBufferArrayImpl(this, copy);
    }

        return createSubDevices(props);
    }

    public CLSubDevice[] createSubDevicesByDomain(AffinityDomain domain) {

        LongBuffer props = Buffers.newDirectLongBuffer(3);
        props.put(CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT).put(domain.TYPE).put(0).rewind();
        return createSubDevices(props);
    }

        if(computeUnitsIndexArray.length == 0) {
            throw new IllegalArgumentException("list was empty");
        }

        LongBuffer props = Buffers.newDirectLongBuffer(computeUnitsIndexArray.length+3);
        props.put(CL_DEVICE_PARTITION_BY_NAMES_EXT);
        for (int units : computeUnitsIndexArray) {
            props.put(units);
        }
        props.put(-1).put(0).rewind();
        return createSubDevices(props)[0];
    }

TOP

Related Classes of java.nio.LongBuffer

Copyright © 2018 www.massapicom. 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.