code: public synchronized void prepareForReception()
     {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "prepareForReception");
  
        long length = prepareForTransmission();
  
        // Allocate another WsByteBuffer to copy it all into
        WsByteBuffer newBuffer = createNewWsByteBuffer((int) length);
        // Now copy in the buffers to the new one
        for (int x = 0; x < dataList.size(); x++)
        {
           WsByteBuffer buff = dataList.get(x);
           newBuffer.put(buff);
        }
        // Now initialise ourselves with the new buffer
        reset(newBuffer);
  
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepareForReception");
     }
docs: This method should be used in the unit test environment where we want to mock up a buffer
  to appear as if it was received across the wire. When this method is called the following
  occurs:
  <ol>
  <li>The buffers that are currently waiting in the data list are prepared (flipped) and
  copied into a single byte buffer.</li>
  <li>The single byte buffer is assigned into the receivedBuffer variable (which now enables
  the getXXX() methods</li>
  <li>The data list is cleared meaning that the putXXX() methods will now fail.</li>
  </ol>
  <p>
  You would be ill-advised to use this method in the main-line code.