code: public ByteBuffer preProcessOneWriteBuffer() {
          // We can process the single buffer case more efficiently than if we
          // include it as a part of the multi-buffer logic
          WsByteBufferImpl wsBuffImpl = null;
          try {
              wsBuffImpl = (WsByteBufferImpl) getBuffer();
          } catch (ClassCastException cce) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Writing with a non-WsByteBufferImpl");
              }
              return getBuffer().getWrappedByteBuffer();
          }
  
          if (!wsBuffImpl.isDirect() && wsBuffImpl.hasArray()) {
              wsBuffImpl.copyToDirectBuffer();
              return wsBuffImpl.oWsBBDirect;
          }
          return wsBuffImpl.getWrappedByteBufferNonSafe();
      }
docs: Before attempting a write of one buffer, perform any work required
  and return the proper NIO buffer to write out.
  
  @return ByteBuffer