reset()
119120121122123124125126127128129
checkStatus(h, buf, "mark", 20, 20, true, 15, 5); // mark should be discarded if new position is smaller than mark buf = factory.newInstance(); buf.position(5); buf.mark(); buf.position(4); try { buf.reset(); h.check(false, "mark: mark not invalidated");
138139140141142143144145146147148
{ Buffer buf = null; buf = factory.newInstance(); buf.position(2); buf.mark(); buf.position(3); h.check(buf.limit(4), buf, "limit: buf.limit(4)"); checkStatus(h, buf, "limit", 20, 4, true, 1, 3); buf.reset(); checkStatus(h, buf, "limit", 20, 4, true, 2, 2);
149150151152153154155156157158159
// mark should be discarded if new limit is smaller than mark // and position should be set to new limit buf = factory.newInstance(); buf.position(5); buf.mark(); buf.position(6); buf.limit(4); checkStatus(h, buf, "limit", 20, 4, false, 0, 4); try {
193194195196197198199200201202203
{ Buffer buf = null; buf = factory.newInstance(); buf.position(5); buf.mark(); buf.position(6); buf.limit(9); h.check(buf.rewind(), buf, "rewind: buf.rewind()"); checkStatus(h, buf, "rewind", 20, 9, true, 9, 0); try
214215216217218219220221222223224
{ Buffer buf = null; buf = factory.newInstance(); buf.position(5); buf.mark(); buf.position(6); buf.limit(7); h.check(buf.clear(), buf, "clear: buf.clear()"); checkStatus(h, buf, "clear", 20, 20, true, 20, 0); try
235236237238239240241242243244245
{ 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 {