code: public MessageBuffer reset(MessageBuffer buf)
      {
          MessageBuffer old = this.buffer;
          this.buffer = buf;
          if (buf == null) {
              isEmpty = true;
          }
          else {
              isEmpty = false;
          }
          return old;
      }
docs: Reset buffer. This method returns the old buffer.
  
  @param buf new buffer. This can be null to make this input empty.
  @return the old buffer.