Home
last modified time | relevance | path

Searched refs:slice (Results 1 – 25 of 78) sorted by relevance

1234

/libcore/ojluni/src/test/java/nio/Buffer/
DStringCharBufferSliceTest.java44 helper(buff, buff.slice()); in testSlice()
45 helper(buff, buff.slice(0, buff.remaining())); in testSlice()
48 helper(buff, buff.slice()); in testSlice()
49 helper(buff, buff.slice(2, buff.remaining())); in testSlice()
52 helper(buff, buff.slice()); in testSlice()
53 helper(buff, buff.slice(0, buff.remaining())); in testSlice()
65 bitest.accept(buff, buff.slice()); in testSlice()
67 bitest.accept(buff, buff.slice(4, 3)); in testSlice()
79 bitest.accept(buff, buff.slice()); in testSlice()
81 bitest.accept(buff, buff.slice(4, 3)); in testSlice()
[all …]
DBasicLong.java199 private static void checkSlice(LongBuffer b, LongBuffer slice) { in checkSlice() argument
200 ck(slice, 0, slice.position()); in checkSlice()
201 ck(slice, b.remaining(), slice.limit()); in checkSlice()
202 ck(slice, b.remaining(), slice.capacity()); in checkSlice()
203 if (b.isDirect() != slice.isDirect()) in checkSlice()
204 fail("Lost direction", slice); in checkSlice()
205 if (b.isReadOnly() != slice.isReadOnly()) in checkSlice()
206 fail("Lost read-only", slice); in checkSlice()
642 catchIndexOutOfBounds(b, () -> b.slice(-1, 7)); in test()
643 catchIndexOutOfBounds(b, () -> b.slice(b.limit() + 1, 7)); in test()
[all …]
DBasicInt.java199 private static void checkSlice(IntBuffer b, IntBuffer slice) { in checkSlice() argument
200 ck(slice, 0, slice.position()); in checkSlice()
201 ck(slice, b.remaining(), slice.limit()); in checkSlice()
202 ck(slice, b.remaining(), slice.capacity()); in checkSlice()
203 if (b.isDirect() != slice.isDirect()) in checkSlice()
204 fail("Lost direction", slice); in checkSlice()
205 if (b.isReadOnly() != slice.isReadOnly()) in checkSlice()
206 fail("Lost read-only", slice); in checkSlice()
642 catchIndexOutOfBounds(b, () -> b.slice(-1, 7)); in test()
643 catchIndexOutOfBounds(b, () -> b.slice(b.limit() + 1, 7)); in test()
[all …]
DBasicShort.java199 private static void checkSlice(ShortBuffer b, ShortBuffer slice) { in checkSlice() argument
200 ck(slice, 0, slice.position()); in checkSlice()
201 ck(slice, b.remaining(), slice.limit()); in checkSlice()
202 ck(slice, b.remaining(), slice.capacity()); in checkSlice()
203 if (b.isDirect() != slice.isDirect()) in checkSlice()
204 fail("Lost direction", slice); in checkSlice()
205 if (b.isReadOnly() != slice.isReadOnly()) in checkSlice()
206 fail("Lost read-only", slice); in checkSlice()
642 catchIndexOutOfBounds(b, () -> b.slice(-1, 7)); in test()
643 catchIndexOutOfBounds(b, () -> b.slice(b.limit() + 1, 7)); in test()
[all …]
DBasicFloat.java199 private static void checkSlice(FloatBuffer b, FloatBuffer slice) { in checkSlice() argument
200 ck(slice, 0, slice.position()); in checkSlice()
201 ck(slice, b.remaining(), slice.limit()); in checkSlice()
202 ck(slice, b.remaining(), slice.capacity()); in checkSlice()
203 if (b.isDirect() != slice.isDirect()) in checkSlice()
204 fail("Lost direction", slice); in checkSlice()
205 if (b.isReadOnly() != slice.isReadOnly()) in checkSlice()
206 fail("Lost read-only", slice); in checkSlice()
642 catchIndexOutOfBounds(b, () -> b.slice(-1, 7)); in test()
643 catchIndexOutOfBounds(b, () -> b.slice(b.limit() + 1, 7)); in test()
[all …]
DBasicDouble.java199 private static void checkSlice(DoubleBuffer b, DoubleBuffer slice) { in checkSlice() argument
200 ck(slice, 0, slice.position()); in checkSlice()
201 ck(slice, b.remaining(), slice.limit()); in checkSlice()
202 ck(slice, b.remaining(), slice.capacity()); in checkSlice()
203 if (b.isDirect() != slice.isDirect()) in checkSlice()
204 fail("Lost direction", slice); in checkSlice()
205 if (b.isReadOnly() != slice.isReadOnly()) in checkSlice()
206 fail("Lost read-only", slice); in checkSlice()
642 catchIndexOutOfBounds(b, () -> b.slice(-1, 7)); in test()
643 catchIndexOutOfBounds(b, () -> b.slice(b.limit() + 1, 7)); in test()
[all …]
DBasicChar.java199 private static void checkSlice(CharBuffer b, CharBuffer slice) { in checkSlice() argument
200 ck(slice, 0, slice.position()); in checkSlice()
201 ck(slice, b.remaining(), slice.limit()); in checkSlice()
202 ck(slice, b.remaining(), slice.capacity()); in checkSlice()
203 if (b.isDirect() != slice.isDirect()) in checkSlice()
204 fail("Lost direction", slice); in checkSlice()
205 if (b.isReadOnly() != slice.isReadOnly()) in checkSlice()
206 fail("Lost read-only", slice); in checkSlice()
642 catchIndexOutOfBounds(b, () -> b.slice(-1, 7)); in test()
643 catchIndexOutOfBounds(b, () -> b.slice(b.limit() + 1, 7)); in test()
[all …]
DBasicByte.java199 private static void checkSlice(ByteBuffer b, ByteBuffer slice) { in checkSlice() argument
200 ck(slice, 0, slice.position()); in checkSlice()
201 ck(slice, b.remaining(), slice.limit()); in checkSlice()
202 ck(slice, b.remaining(), slice.capacity()); in checkSlice()
203 if (b.isDirect() != slice.isDirect()) in checkSlice()
204 fail("Lost direction", slice); in checkSlice()
205 if (b.isReadOnly() != slice.isReadOnly()) in checkSlice()
206 fail("Lost read-only", slice); in checkSlice()
364 ByteBuffer ab = intermediate.slice(); in testAlign()
376 intermediate = (ByteBuffer) ab.slice().position(p).limit(l); in testAlign()
[all …]
DBasic-X.java.template199 private static void checkSlice($Type$Buffer b, $Type$Buffer slice) {
200 ck(slice, 0, slice.position());
201 ck(slice, b.remaining(), slice.limit());
202 ck(slice, b.remaining(), slice.capacity());
203 if (b.isDirect() != slice.isDirect())
204 fail("Lost direction", slice);
205 if (b.isReadOnly() != slice.isReadOnly())
206 fail("Lost read-only", slice);
360 // Created aligned slice to test against
364 ByteBuffer ab = intermediate.slice();
[all …]
/libcore/luni/src/test/java/libcore/java/nio/
DBufferTest.java250 assertEquals(ByteOrder.BIG_ENDIAN, b.slice().order()); in testByteBufferByteOrder()
252 assertEquals(ByteOrder.BIG_ENDIAN, b.slice().order()); in testByteBufferByteOrder()
290 assertEquals(bo, b.slice().order()); in testCharBufferByteOrder()
294 assertEquals(bo, b.slice().order()); in testCharBufferByteOrder()
321 assertEquals(bo, b.slice().order()); in testDoubleBufferByteOrder()
325 assertEquals(bo, b.slice().order()); in testDoubleBufferByteOrder()
352 assertEquals(bo, b.slice().order()); in testFloatBufferByteOrder()
356 assertEquals(bo, b.slice().order()); in testFloatBufferByteOrder()
383 assertEquals(bo, b.slice().order()); in testIntBufferByteOrder()
387 assertEquals(bo, b.slice().order()); in testIntBufferByteOrder()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DSliceSliceDirectByteBufferTest.java25 buf = buf.slice(); in setUp()
27 buf = buf.slice(); in setUp()
DIntBufferTest.java571 IntBuffer slice = buf.slice(); in testSlice() local
572 assertEquals(buf.isReadOnly(), slice.isReadOnly()); in testSlice()
573 assertEquals(buf.isDirect(), slice.isDirect()); in testSlice()
574 assertEquals(buf.order(), slice.order()); in testSlice()
575 assertEquals(slice.position(), 0); in testSlice()
576 assertEquals(slice.limit(), buf.remaining()); in testSlice()
577 assertEquals(slice.capacity(), buf.remaining()); in testSlice()
579 slice.reset(); in testSlice()
586 if (!slice.isReadOnly()) { in testSlice()
587 loadTestData1(slice); in testSlice()
[all …]
DDoubleBufferTest.java595 DoubleBuffer slice = buf.slice();
596 assertEquals(buf.isReadOnly(), slice.isReadOnly());
597 assertEquals(buf.isDirect(), slice.isDirect());
598 assertEquals(buf.order(), slice.order());
599 assertEquals(slice.position(), 0);
600 assertEquals(slice.limit(), buf.remaining());
601 assertEquals(slice.capacity(), buf.remaining());
603 slice.reset();
611 if (!slice.isReadOnly()) {
612 loadTestData1(slice);
[all …]
DFloatBufferTest.java595 FloatBuffer slice = buf.slice(); in testSlice() local
596 assertEquals(buf.isReadOnly(), slice.isReadOnly()); in testSlice()
597 assertEquals(buf.isDirect(), slice.isDirect()); in testSlice()
598 assertEquals(buf.order(), slice.order()); in testSlice()
599 assertEquals(slice.position(), 0); in testSlice()
600 assertEquals(slice.limit(), buf.remaining()); in testSlice()
601 assertEquals(slice.capacity(), buf.remaining()); in testSlice()
603 slice.reset(); in testSlice()
610 if (!slice.isReadOnly()) { in testSlice()
611 loadTestData1(slice); in testSlice()
[all …]
DLongBufferTest.java578 LongBuffer slice = buf.slice(); in testSlice() local
579 assertEquals(buf.isReadOnly(), slice.isReadOnly()); in testSlice()
580 assertEquals(buf.isDirect(), slice.isDirect()); in testSlice()
581 assertEquals(buf.order(), slice.order()); in testSlice()
582 assertEquals(slice.position(), 0); in testSlice()
583 assertEquals(slice.limit(), buf.remaining()); in testSlice()
584 assertEquals(slice.capacity(), buf.remaining()); in testSlice()
586 slice.reset(); in testSlice()
593 if (!slice.isReadOnly()) { in testSlice()
594 loadTestData1(slice); in testSlice()
[all …]
DShortBufferTest.java558 ShortBuffer slice = buf.slice(); in testSlice() local
559 assertEquals(buf.isReadOnly(), slice.isReadOnly()); in testSlice()
560 assertEquals(buf.isDirect(), slice.isDirect()); in testSlice()
561 assertEquals(buf.order(), slice.order()); in testSlice()
562 assertEquals(slice.position(), 0); in testSlice()
563 assertEquals(slice.limit(), buf.remaining()); in testSlice()
564 assertEquals(slice.capacity(), buf.remaining()); in testSlice()
566 slice.reset(); in testSlice()
573 if (!slice.isReadOnly()) { in testSlice()
574 loadTestData1(slice); in testSlice()
[all …]
DCharBufferTest.java627 CharBuffer slice = buf.slice(); in testSlice() local
628 assertEquals(buf.isReadOnly(), slice.isReadOnly()); in testSlice()
629 assertEquals(buf.isDirect(), slice.isDirect()); in testSlice()
630 assertEquals(buf.order(), slice.order()); in testSlice()
631 assertEquals(slice.position(), 0); in testSlice()
632 assertEquals(slice.limit(), buf.remaining()); in testSlice()
633 assertEquals(slice.capacity(), buf.remaining()); in testSlice()
635 slice.reset(); in testSlice()
642 if (!slice.isReadOnly()) { in testSlice()
643 loadTestData1(slice); in testSlice()
[all …]
DSliceDirectByteBufferTest.java25 buf = buf.slice(); in setUp()
DSliceWrappedByteBufferTest.java25 buf = buf.slice(); in setUp()
DSliceHeapByteBufferTest.java25 buf = buf.slice(); in setUp()
/libcore/ojluni/src/test/java/lang/invoke/VarHandles/
DVarHandleBaseByteArrayTest.java295 … new ByteBufferSource(ByteBuffer.wrap(array, array.length / 4, array.length / 2).slice(), in setupByteSources()
304 … new ByteBufferSource(ByteBuffer.wrap(array, array.length / 4 - 1, array.length / 2).slice(), in setupByteSources()
324 …eBufferSource(((ByteBuffer) dbb.s.slice().position(array.length / 4).limit(array.length / 4 + arra… in setupByteSources()
334 …ferSource(((ByteBuffer) dbb.s.slice().position(array.length / 4 - 1).limit(array.length / 4 - 1 + … in setupByteSources()
/libcore/luni/src/test/java/libcore/java/nio/charset/
DCharsetDecoderTest.java43 ByteBuffer inBuffer = ByteBuffer.wrap(arr, 0, arr.length).slice(); in test_ByteArray_decode_no_offset()
59 ByteBuffer inBuffer = ByteBuffer.wrap(arr, offset, arr.length - offset).slice(); in test_ByteArray_decode_with_offset()
117 CharBuffer out = cb.slice(); in testBufferWithNonZeroOffset()
/libcore/ojluni/src/main/java/java/nio/
DMappedByteBuffer.java225 public abstract ByteBuffer slice(); in slice() method in MappedByteBuffer
238 public abstract MappedByteBuffer slice(int index, int length); in slice() method in MappedByteBuffer
DByteBufferAsShortBuffer.java58 public ShortBuffer slice() { in slice() method in ByteBufferAsShortBuffer
69 public ShortBuffer slice(int index, int length) { in slice() method in ByteBufferAsShortBuffer
DStringCharBuffer.java45 public CharBuffer slice() { in slice() method in StringCharBuffer
55 public CharBuffer slice(int index, int length) { in slice() method in StringCharBuffer

1234