Lines Matching refs:slice

26  * @summary (bf) CharBuffer.slice() on wrapped CharSequence results in wrong position
34 ">>> StringCharBufferSliceTest-main: testing the slice method...");
42 test(buff, buff.slice());
48 test(buff, buff.slice());
54 test(buff, buff.slice());
57 ">>> StringCharBufferSliceTest-main: testing slice result with get()");
60 CharBuffer slice = buff.slice();
62 if (slice.get() != buff.get()) {
63 throw new RuntimeException("Wrong characters in slice result.");
68 ">>> StringCharBufferSliceTest-main: testing slice result with get(int)");
71 slice = buff.slice();
73 if (slice.get(i) != buff.get(4 + i)) {
74 throw new RuntimeException("Wrong characters in slice result.");
79 ">>> StringCharBufferSliceTest-main: testing slice with result of slice");
82 slice = buff.slice();
84 slice.position(i);
85 CharBuffer nextSlice = slice.slice();
88 if (!nextSlice.equals(slice))
90 slice = nextSlice;
97 slice = buff.slice();
98 if (!slice.toString().equals("tes")) {
99 throw new RuntimeException("bad toString() after slice(): " + slice.toString());
106 slice = buff.slice();
107 CharSequence subSeq = slice.subSequence(1, 3);
109 throw new RuntimeException("bad subSequence() after slice(): '" + subSeq + "'");
116 slice = buff.slice();
117 CharBuffer dupe = slice.duplicate();
120 throw new RuntimeException("bad duplicate() after slice(): '" + dupe + "'");
126 public static void test(CharBuffer buff, CharBuffer slice) throws RuntimeException {
130 slice.reset();
138 slice.position() != 0 ||
139 buff.remaining() != slice.limit() ||
140 buff.remaining() != slice.capacity()) {
143 "Calling the CharBuffer.slice method failed.");