Package java.nio

Examples of java.nio.Buffer.position()


    // 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


  private void limit(TestHarness h, BufferFactory factory)
  {
    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();
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

    checkStatus(h, buf, "limit", 10, 4, true, 2, 2);

    // 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

    // 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
      {
        buf.reset();
View Full Code Here

  private void rewind(TestHarness h, BufferFactory factory)
  {
    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);
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

  private void clear(TestHarness h, BufferFactory factory)
  {
    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);
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

  private void flip(TestHarness h, BufferFactory factory)
  {
    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

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.