private static void send(
      final int bytesToSend,
      final NioFilter filter,
      final SocketChannel channel,
      final int startingValue)
      throws IOException {
    // if we wanted to send more than one buffer-full we could add an outer loop
    final ByteBuffer appData = ByteBuffer.allocateDirect(bytesToSend);
    for (int i = 0; i < bytesToSend; i++) {
      appData.put((byte) (i + startingValue));
    }
    appData.flip();
    try (final ByteBufferSharing netDataSharing = filter.wrap(appData)) {
      final ByteBuffer netData = netDataSharing.getBuffer();
      while (netData.remaining() > 0) {
        channel.write(netData);
      }
    }
  }
This method is trying to do what Connection readMessages() and processInputBuffer() do
together.

Note well: peerNetData may contain content on entry to this method. Also the filter's
buffers (e.g. the buffer returned by unwrap) may already contain data from previous
calls to unwrap().

@param peerNetData will be in write mode on entry and may already contain content
geode-core/src/integrationTest/java/org/apache/geode/internal/net/NioSslEngineKeyUpdateTest.java