public ByteBuffer getBytes() {
    int bufSize = 0;
    bufSize += HEADER_LENGTH;
    if (opcode.equals(TapOpcode.MUTATION)) {
      bufSize += 16;
    }
    bufSize += getTotalbody();

    ByteBuffer bb = ByteBuffer.allocate(bufSize);
    bb.put(magic.getMagic());
    bb.put(opcode.getOpcode());
    bb.putShort(keylength);
    bb.put(extralength);
    bb.put(datatype);
    bb.putShort(vbucket);
    bb.putInt(totalbody);
    bb.putInt(opaque);
    bb.putLong(cas);

    if (opcode.equals(TapOpcode.NOOP)) {
      return bb;
    }

    bb.putShort(engineprivate);

    short flag = 0;
    for (int i = 0; i < flags.size(); i++) {
      flag |= flags.get(i).getFlags();
    }

    bb.putShort(flag);
    bb.put(ttl);
    bb.put(reserved1);
    bb.put(reserved2);
    bb.put(reserved3);

    if (opcode.equals(TapOpcode.MUTATION)) {
      bb.putInt(itemflags);
      bb.putInt(itemexpiry);
      bb.put(revid);
      bb.put(key);
      bb.put(value);
    } else if (opcode.equals(TapOpcode.DELETE)) {
      bb.put(revid);
      bb.put(key);
    } else if (opcode.equals(TapOpcode.VBUCKETSET)) {
      bb.putInt(vbucketstate);
    }
    return bb;
  }
Gets the value of the revid field. Only returned with a tap mutation
message.

@return The revid of the document.
src/main/java/net/spy/memcached/tapmessage/ResponseMessage.java