Package java.nio

Examples of java.nio.ByteBuffer.position()


        (int) nanos / 1000);

    /*
     * Now copy the data into our new record buffer
     */
    record.position(SnoopPacketRecord.HEADER_LENGTH);
    record.put(data);

    this.raw.add(record);
  }

 
View Full Code Here


    if (hasNext() == false) {
      throw new IllegalStateException(
          "Exhausted all records while searching for timestamp");
    } else {
      buffer = next();
      s = (Long) SECONDS.read(buffer, buffer.position());
      m = (Long) MICROS.read(buffer, buffer.position());

    }

    // Check if we are not already passed it
View Full Code Here

      throw new IllegalStateException(
          "Exhausted all records while searching for timestamp");
    } else {
      buffer = next();
      s = (Long) SECONDS.read(buffer, buffer.position());
      m = (Long) MICROS.read(buffer, buffer.position());

    }

    // Check if we are not already passed it
    if (seconds < s || (seconds == s && micros < m)) {
View Full Code Here

    if (hasNext() == false) {
      throw new IllegalStateException(
          "Exhausted all records while searching for timestamp");
    } else {
      buffer = next();
      s = (Long) SECONDS.read(buffer, buffer.position());
      m = (Long) MICROS.read(buffer, buffer.position());
    }

    // Check if we are not already passed it
    if (seconds < s || (seconds == s && micros < m)) {
View Full Code Here

      throw new IllegalStateException(
          "Exhausted all records while searching for timestamp");
    } else {
      buffer = next();
      s = (Long) SECONDS.read(buffer, buffer.position());
      m = (Long) MICROS.read(buffer, buffer.position());
    }

    // Check if we are not already passed it
    if (seconds < s || (seconds == s && micros < m)) {
      return seek(seconds, micros, start, length / 2.);
View Full Code Here

    while (hasNext()) {
      p = getPosition();
      ByteBuffer buffer = next();

      s = (Long) SECONDS.read(buffer, buffer.position());
      m = (Long) MICROS.read(buffer, buffer.position());

      if (s > seconds || (s == seconds && m >= micros)) {
        setPosition(p);
View Full Code Here

    while (hasNext()) {
      p = getPosition();
      ByteBuffer buffer = next();

      s = (Long) SECONDS.read(buffer, buffer.position());
      m = (Long) MICROS.read(buffer, buffer.position());

      if (s > seconds || (s == seconds && m >= micros)) {
        setPosition(p);

        return SeekResult.Fullfilled;
View Full Code Here

  }

  ByteBuffer getValueAsByteBuffer() {
    ByteBuffer result = Misc.getByteBuffer(hash.length());
    result.put(hash.getHash());
    result.position(0);
    return result;
  }


  int getValueLength() {
View Full Code Here

  }

  ByteBuffer getValueAsByteBuffer() {
    ByteBuffer result = Misc.getByteBuffer(1);
    result.put((byte) (tagValue ? 1 : 0 ));
    result.position(0);
    return result;
  }

  int getValueLength() {
    return 1;
View Full Code Here

 
  ByteBuffer getValueAsByteBuffer() {
    ByteBuffer result = Misc.getByteBuffer(2 + tagValue.getBytes().length);
    result.putShort(Convert.intToShort(tagValue.getBytes().length));
    result.put(tagValue.getBytes());
    result.position(0);
    return result;
  }

  int getValueLength() {
    return tagValue.getBytes().length + 2;
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.