public void clear() {
    isRetry = false;
    int len = payloadLength;
    if (len != 0) {
      payloadLength = 0;
    }
    if (readHeader) {
      if (messageStats != null) {
        messageStats.decMessagesBeingReceived(len);
      }
    }
    ByteBuffer buffer = getCommBuffer();
    if (buffer != null) {
      buffer.clear();
    }
    clearParts();
    if (len != 0 && dataLimiter != null) {
      dataLimiter.release(len);
      dataLimiter = null;
      maxIncomingMessageLength = 0;
    }
    if (readHeader) {
      if (messageLimiter != null) {
        messageLimiter.release(1);
        messageLimiter = null;
      }
      readHeader = false;
    }
    flags = 0;
  }
Adds a new part to this message that may contain a serialized object.
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java