title: Recover JSON array field to a byte array in spring
body: <p>I am new to spring and here I am sending an http request which needs to pass a message to server. But the message should be sent as a byte array. I use the following curl command. Here the message passed is "hello".</p>
  
  <pre><code>curl -i -H "Content-type: application/json" -X POST -d '{"message":[72,69,76,76,79]}' http://localhost:8080/json
  </code></pre>
  
  <p>Controller should listen to the request and recover the message field to a byte[] again. 
  Controller Code:</p>
  
  <pre><code>@RequestMapping(value = "/json", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
  @ResponseBody
  public ResponseEntity&lt;Map&lt;String, Object&gt;&gt; jsonReceiver(@RequestHeader Map&lt;String, String&gt; headers, @RequestBody Map&lt;String, Object&gt; request) {
  
      String bytes = request.get("message").toString();
  
      LOGGER.info("Message: {}", bytes);
      Map&lt;String, Object&gt; response = new HashMap&lt;&gt;();
  
      response.put("status-code", "1000");
      response.put("success", "true");
  
      HttpHeaders respHeaders = new HttpHeaders();
      respHeaders.add("Pragma", "ack");
      return new ResponseEntity&lt;Map&lt;String, Object&gt;&gt;(response, respHeaders, HttpStatus.ACCEPTED);}
  </code></pre>
  
  <p>Here I can get the output as an string. But I want to get it to a byte[].
  Is there any way to get this as a byte array from controller without reading as a string and then manipulating it. </p>
  
  <pre><code>Message: [72,69,76,76,79]
  </code></pre>