code: private void sendMessage(NetworkMessage message)
      {
          try (ByteArrayOutputStream encode = message.encode())
          {
              final byte[] encoded = encode.toByteArray();
              // Message header
              out.writeByte(NetworkMessageSystemId.USER_MESSAGE);
              out.writeByte(message.getClientId());
              out.writeByte(message.getClientDestId());
              out.writeByte(message.getType());
              // Message content
              out.writeInt(encoded.length);
              out.write(encoded);
              out.flush();
  
              final int headerSize = 8;
              bandwidth += headerSize + encoded.length;
          }
          catch (final IOException exception)
          {
              Verbose.exception(exception, "Unable to send the message for client: ", String.valueOf(clientId));
          }
      }
docs: Send message over the network.
  
  @param message The message to send.