Package java.nio

Examples of java.nio.Buffer.mark()


  {
    Buffer buf = null;

    // mark at default position
    buf = factory.newInstance();
    h.check(buf.mark(), buf, "mark: buf.mark()");
    checkStatus(h, buf, "mark", 10, 10, true, 10, 0);
    buf.position(5);
    checkStatus(h, buf, "mark", 10, 10, true, 5, 5);
    h.check(buf.reset(), buf, "mark: buf.reset()");
    checkStatus(h, buf, "mark", 10, 10, true, 10, 0);
View Full Code Here


    checkStatus(h, buf, "mark", 10, 10, true, 10, 0);

    // mark at specified position
    buf = factory.newInstance();
    buf.position(5);
    buf.mark();
    checkStatus(h, buf, "mark", 10, 10, true, 5, 5);
    buf.position(6);
    checkStatus(h, buf, "mark", 10, 10, true, 4, 6);
    buf.reset();
    checkStatus(h, buf, "mark", 10, 10, true, 5, 5);
View Full Code Here

    checkStatus(h, buf, "mark", 10, 10, true, 5, 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");
View Full Code Here

  {
    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", 10, 4, true, 1, 3);
    buf.reset();
    checkStatus(h, buf, "limit", 10, 4, true, 2, 2);
View Full Code Here

    // 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", 10, 4, false, 0, 4);
    try
      {
View Full Code Here

  {
    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", 10, 9, true, 9, 0);
    try
View Full Code Here

  {
    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", 10, 10, true, 10, 0);
    try
View Full Code Here

  {
    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", 10, 6, true, 6, 0);
    try
      {
View Full Code Here

  {
    Buffer buf = null;

    // mark at default position
    buf = factory.newInstance();
    h.check(buf.mark(), buf, "mark: buf.mark()");
    checkStatus(h, buf, "mark", 20, 20, true, 10, 10);
    buf.position(15);
    checkStatus(h, buf, "mark", 20, 20, true, 5, 15);
    h.check(buf.reset(), buf, "mark: buf.reset()");
    checkStatus(h, buf, "mark", 20, 20, true, 10, 10);
View Full Code Here

    checkStatus(h, buf, "mark", 20, 20, true, 10, 10);

    // mark at specified position
    buf = factory.newInstance();
    buf.position(5);
    buf.mark();
    checkStatus(h, buf, "mark", 20, 20, true, 15, 5);
    buf.position(6);
    checkStatus(h, buf, "mark", 20, 20, true, 14, 6);
    buf.reset();
    checkStatus(h, buf, "mark", 20, 20, true, 15, 5);
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.