title: Spring Rest API Byte[] as a property of returning Object issue
body: <p>With Spring Rest I am returning a JSON object with an API endpoint with a byte array of an base64 String property but its returning String data for byte array,however  mapping of HttpMessageConverter is ok when i am taking as input the same with another API
          @PostMapping("/document-add")
          public List addDocument(@RequestBody ArrayList dd, @RequestHeader String sessionId) {
              LOGGER.info("Entered addDocument() -> dd.size= "+dd.size());
              return uploadService.uploadDocument(dd, sessionId);
          }</p>
  
  <pre><code>    //@RequestMapping(value="/document-get", produces = MediaType.APPLICATION_JSON_VALUE)
      @GetMapping(value="/document-get", produces = MediaType.ALL_VALUE) 
      ResponseEntity&lt;ArrayList&lt;BinaryData&gt;&gt; getDocument(@RequestHeader String sessionId,@RequestHeader String documents) {
          return new ResponseEntity&lt;&gt;(downloadService.downloadDocuments(sessionId,documents), HttpStatus.ACCEPTED);
          //return downloadService.downloadDocuments(sessionId,documents);
      }
  
  public class BinaryData implements Serializable{
  
      /**
       * 
       */
      private static final long serialVersionUID = 5165348244266958806L;
      private int imageIndex;
      private byte[] data;
      private String error;
      public BinaryData() {
          // TODO Auto-generated constructor stub
      }
      /**
       * @param imageIndex
       * @param data
       */
      public BinaryData(int imageIndex, byte[] data,String error) {
          super();
          this.imageIndex = imageIndex;
          this.data = data;
          this.error = error;
      }
  
      /**
       * @return the imageIndex
       */
      public int getimageIndex() {
          return imageIndex;
      }
      /**
       * @param imageIndex the imageIndex to set
       */
      public void setimageIndex(int imageIndex) {
          this.imageIndex = imageIndex;
      }
      /**
       * @return the data
       */
      public byte[] getData() {
          return data;
      }
      /**
       * @param data the data to set
       */
      public void setData(byte[] data) {
          this.data = data;
      }
  
      /**
       * @return the error
       */
      public String getError() {
          return error;
      }
      /**
       * @param error the error to set
       */
      public void setError(String error) {
          this.error = error;
      }
      /* (non-Javadoc)
       * @see java.lang.Object#hashCode()
       */
      @Override
      public int hashCode() {
          final int prime = 31;
          int result = 1;
          result = prime * result + Arrays.hashCode(data);
          result = prime * result + imageIndex;
          result = prime * result + ((error == null) ? 0 : error.hashCode());
          return result;
      }
      /* (non-Javadoc)
       * @see java.lang.Object#equals(java.lang.Object)
       */
      @Override
      public boolean equals(Object obj) {
          if (this == obj)
              return true;
          if (obj == null)
              return false;
          if (getClass() != obj.getClass())
              return false;
          BinaryData other = (BinaryData) obj;
          if (!Arrays.equals(data, other.data))
              return false;
          if (imageIndex != other.imageIndex)
              return false;
          if (error == null) {
              if (other.error != null)
                  return false;
          } else if (!error.equals(other.error))
              return false;
          return true;
      }
      /* (non-Javadoc)
       * @see java.lang.Object#toString()
       */
      @Override
      public String toString() {
          return "BinaryData [imageIndex=" + imageIndex + ", data=" + Arrays.toString(data) + ", error=" + error + "]";
  //      return "BinaryData [imageIndex=" + imageIndex + ", data==" + data + ", error=" + error + "]";
  
      }
  
  
  import java.util.Arrays;
  
  /**
   * @author **strong text**
   *
   */
  public class DocumentData {
  
      private String customerId, applicationId, loanId, documentType, docN, financeType;
      private byte[] binData;
  
      public DocumentData() {
          // TODO Auto-generated constructor stub
      }
  
      public DocumentData(String customerId, String applicationId, String loanId, String documentType, String docN,
              String financeType, byte[] binData) {
          super();
          this.customerId = customerId;
          this.applicationId = applicationId;
          this.loanId = loanId;
          this.documentType = documentType;
          this.docN = docN;
          this.financeType = financeType;
          this.binData = binData;
      }
  
      public String getCustomerId() {
          return customerId;
      }
  
      public void setCustomerId(String customerId) {
          this.customerId = customerId;
      }
  
      public String getApplicationId() {
          return applicationId;
      }
  
      public void setApplicationId(String applicationId) {
          this.applicationId = applicationId;
      }
  
      public String getDocumentType() {
          return documentType;
      }
  
      public void setDocumentType(String documentType) {
          this.documentType = documentType;
      }
  
      public String getDocN() {
          return docN;
      }
  
      public void setDocN(String docN) {
          this.docN = docN;
      }
  
      public String getLoanId() {
          return loanId;
      }
  
      public void setLoanId(String loanId) {
          this.loanId = loanId;
      }
  
      public byte[] getBinData() {
          return binData;
      }
  
      public void setBinData(byte[] binData) {
          this.binData = binData;
      }
  
      public String getFinanceType() {
          return financeType;
      }
  
      public void setFinanceType(String financeType) {
          this.financeType = financeType;
      }
  
      @Override
      public int hashCode() {
          final int prime = 31;
          int result = 1;
          result = prime * result + ((applicationId == null) ? 0 : applicationId.hashCode());
          result = prime * result + Arrays.hashCode(binData);
          result = prime * result + ((customerId == null) ? 0 : customerId.hashCode());
          result = prime * result + ((docN == null) ? 0 : docN.hashCode());
          result = prime * result + ((documentType == null) ? 0 : documentType.hashCode());
          result = prime * result + ((financeType == null) ? 0 : financeType.hashCode());
          result = prime * result + ((loanId == null) ? 0 : loanId.hashCode());
          return result;
      }
  
      @Override
      public boolean equals(Object obj) {
          if (this == obj)
              return true;
          if (obj == null)
              return false;
          if (getClass() != obj.getClass())
              return false;
          DocumentData other = (DocumentData) obj;
          if (applicationId == null) {
              if (other.applicationId != null)
                  return false;
          } else if (!applicationId.equals(other.applicationId))
              return false;
          if (!Arrays.equals(binData, other.binData))
              return false;
          if (customerId == null) {
              if (other.customerId != null)
                  return false;
          } else if (!customerId.equals(other.customerId))
              return false;
          if (docN == null) {
              if (other.docN != null)
                  return false;
          } else if (!docN.equals(other.docN))
              return false;
          if (documentType == null) {
              if (other.documentType != null)
                  return false;
          } else if (!documentType.equals(other.documentType))
              return false;
          if (financeType == null) {
              if (other.financeType != null)
                  return false;
          } else if (!financeType.equals(other.financeType))
              return false;
          if (loanId == null) {
              if (other.loanId != null)
                  return false;
          } else if (!loanId.equals(other.loanId))
              return false;
          return true;
      }
  
      @Override
      public String toString() {
          return "DocumentData [customerId=" + customerId + ", applicationId=" + applicationId + ", loanId=" + loanId
                  + ", documentType=" + documentType + ", docN=" + docN + ", financeType=" + financeType + ", binData="
                  + Arrays.toString(binData) + "]";
      }
  
  }
  @Post input sample
      [
      {   
      "customerId":"131", 
      "applicationId":"99", 
      "loanId":"9", 
      "documentType":"xlsx", 
      "docN":"OPPO_MOM.xlsx", 
      "financeType":"LM",
      "binData":[85, 69, 115, 68, 66, 66, 81, 65, 66, 103, 65, 73, 65, 65, 65, 65, 73, 81, 66, 55, 107,  89, 97, 76, 87, 121, 69, 87, 53, 70, 122, 88, 55, 43, 80, 105, 50, 105, 67, 89, 48, 47, 57, 116, 54, 53, 119, 65, 68, 122, 70, 99, 102, 66, 52, 83, 54, 50, 122, 70, 71, 115, 118, 73, 110, 122, 97, 112, 101,  65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 74, 103, 110, 65, 65, 66, 107, 98, 50, 78, 81, 99, 109, 57, 119, 99, 121, 57, 106, 100, 88, 78, 48, 98, 50, 48, 117, 101, 71, 49, 115, 85, 69, 115, 70, 66, 103, 65, 65, 65, 65, 65, 78, 65, 65, 48, 65, 90, 119, 77, 65, 65, 78, 52, 112, 65, 65, 65, 65, 65, 65, 61, 61]
      }
  ]
  
  @Get output sample
  [
      {
          "imageIndex": 59,
          "data": "VUVzREJCUUFCZ0FJQUFBQUlRQjdrc2doZWdFQUFJRUZBQUFUQUFnQ1cwTnZiblJsYm5SZlZIbHdaWE5kTG5odGJDQ2lCQUlvb0FBQ0FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU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