code: public static RawMessage toRawMessage(final short sendingNodeId, final ByteBuffer buffer) {
      buffer.flip();
  
      final RawMessage message = new RawMessage(buffer.limit());
  
      message.put(buffer, false);
  
      buffer.clear();
  
      final RawMessageHeader header = new RawMessageHeader(sendingNodeId, (short) 0, (short) message.length());
  
      message.header(header);
  
      return message;
    }
docs: Uses buffer.flip() and then buffer.clear()
  @param sendingNodeId short
  @param buffer ByteBuffer
  @return RawMessage