title: How to convert protocol buffers message to byte[]
body: <p>here is my code i'm still new with this protocol buffer how can i convert the protocol buffer to byte[] so that i can encrypte</p>
  
  <pre><code>for (ClientRequest req : check.getClientRequestGroup().getClientRequests()) {
              ClientRequestProtos.GetUnixDormantUsers.Builder guduBuilder =     ClientRequestProtos.GetUnixDormantUsers.newBuilder();
              guduBuilder.setCheckFiles(true);
              guduBuilder.setCheckProcesses(true);
              guduBuilder.setThreshold(30);
              guduBuilder.addExcludeUser("root");
              guduBuilder.addExcludeUser("bin");
              ClientRequestProtos.GetUnixDormantUsers guduMessage = guduBuilder.build();
  
              ClientRequestProtos.ClientRequest.Builder clientBuilder = ClientRequestProtos.ClientRequest.newBuilder();
              clientBuilder.setId(req.getId());
              clientBuilder.setSentAt(req.getSentAt().getTime());
              clientBuilder.setType(ClientRequestType.GET_UNIX_DORMANT_USERS);
              clientBuilder.setGetUnixDormantUsers(guduMessage);
              ClientRequestProtos.ClientRequest clientMessage = clientBuilder.build();
  
  
  
  String ipAddress = mapHostIp.get(req.getHost());
                  GenericUrl url = new GenericUrl("http://"+ ipAddress+":5736/request");
  byte[] content; // convert protocol buffers to byte[]
  
  
              byte[] encrypted = Encrypt.encrypt(content);
              HttpRequest request = requestFactory.buildPostRequest(url, new ByteArrayContent(null, encrypted));
              request.execute();
          }
  </code></pre>