Package java.nio

Examples of java.nio.FloatBuffer.position()


        if (newOffset == offset && newLength == length) {
            return this;
        }
        subArrayCheck(newOffset, newLength);
        FloatBuffer copy = elements.duplicate();
        copy.position(newOffset);
        copy.limit(newOffset + newLength);
        return new SubMutableFloatBufferArrayImpl(this, copy);
    }

    @SuppressWarnings({"MissingMethodJavaDoc", "MissingFieldJavaDoc"})
View Full Code Here


    public BoundedFloatArray offset(int offset) {
        int newOffset = elements.position() + offset;
        int newLength = elements.remaining() - offset;
        subArrayCheck(newOffset, newLength);
        FloatBuffer copy = elements.duplicate();
        copy.position(newOffset);
        return new SubBoundedFloatBufferArrayImpl(this, copy);
    }

    /**
     * <p>Returns a new sub array object for the specified {@code length}. Note that {@code length} must be smaller than
View Full Code Here

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

    /**
 
View Full Code Here

        }
        int newOffset = elements.position() + offset;
        int newLength = elements.remaining() - offset;
        subArrayCheck(newOffset, newLength);
        FloatBuffer copy = elements.duplicate();
        copy.position(newOffset);
        return new FloatBufferArrayImpl(copy, characteristics, false);
    }

    /**
     * <p>Returns a new sub array object for the specified {@code length}. Note that {@code length} must be smaller than
View Full Code Here

        if (newOffset == offset && newLength == length) {
            return this;
        }
        subArrayCheck(newOffset, newLength);
        FloatBuffer copy = elements.duplicate();
        copy.position(newOffset);
        copy.limit(newOffset + newLength);
        return new FloatBufferArrayImpl(copy, characteristics, false);
    }

    @SuppressWarnings({"MissingMethodJavaDoc", "MissingFieldJavaDoc"})
View Full Code Here

        // readonly's contents should be the same as buf
        FloatBuffer readonly = buf.asReadOnlyBuffer();
        assertNotSame(buf, readonly);
        assertTrue(readonly.isReadOnly());
        assertEquals(buf.position(), readonly.position());
        assertEquals(buf.limit(), readonly.limit());
        assertEquals(buf.isDirect(), readonly.isDirect());
        assertEquals(buf.order(), readonly.order());
        assertContentEquals(buf, readonly);
View Full Code Here

        assertEquals(buf.order(), readonly.order());
        assertContentEquals(buf, readonly);

        // readonly's position, mark, and limit should be independent to buf
        readonly.reset();
        assertEquals(readonly.position(), 0);
        readonly.clear();
        assertEquals(buf.position(), buf.limit());
        buf.reset();
        assertEquals(buf.position(), 0);
    }
View Full Code Here

        assertEquals(0, buf.compareTo(other));
        assertEquals(0, other.compareTo(buf));
        buf.position(1);
        assertTrue(buf.compareTo(other) > 0);
        assertTrue(other.compareTo(buf) < 0);
        other.position(2);
        assertTrue(buf.compareTo(other) < 0);
        assertTrue(other.compareTo(buf) > 0);
        buf.position(2);
        other.limit(5);
        assertTrue(buf.compareTo(other) > 0);
View Full Code Here

        buf.position(buf.limit());

        // duplicate's contents should be the same as buf
        FloatBuffer duplicate = buf.duplicate();
        assertNotSame(buf, duplicate);
        assertEquals(buf.position(), duplicate.position());
        assertEquals(buf.limit(), duplicate.limit());
        assertEquals(buf.isReadOnly(), duplicate.isReadOnly());
        assertEquals(buf.isDirect(), duplicate.isDirect());
        assertEquals(buf.order(), duplicate.order());
        assertContentEquals(buf, duplicate);
View Full Code Here

        assertEquals(buf.order(), duplicate.order());
        assertContentEquals(buf, duplicate);

        // duplicate's position, mark, and limit should be independent to buf
        duplicate.reset();
        assertEquals(duplicate.position(), 0);
        duplicate.clear();
        assertEquals(buf.position(), buf.limit());
        buf.reset();
        assertEquals(buf.position(), 0);
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.