code: public MessageBufferInput reset(MessageBufferInput in)
              throws IOException
      {
          MessageBufferInput newIn = checkNotNull(in, "MessageBufferInput is null");
  
          // Reset the internal states
          MessageBufferInput old = this.in;
          this.in = newIn;
          this.buffer = EMPTY_BUFFER;
          this.position = 0;
          this.totalReadBytes = 0;
          // No need to initialize the already allocated string decoder here since we can reuse it.
  
          return old;
      }
docs: Replaces underlying input.
  <p>
  This method clears internal buffer, swaps the underlying input with the new given input, then returns
  the old input.
  
  <p>
  This method doesn't close the old input.
  
  @param in new input
  @return the old input
  @throws IOException never happens unless a subclass overrides this method
  @throws NullPointerException the given input is null