title: Convert byte[] to String for HTML file
body: <p>I upload HTML file into DB as byte[] in blob column, and in another part I have to retrieve this file and display in textarea, I'm able to retrieve from DB as bytes and convert it into string, but when display its shows as encrypt format.</p>
  
  <p>This is the struts application:</p>
  
  <p>This is my jsp:</p>
  
  <pre><code>&lt;tr&gt;
   &lt;td colspan="3" class="searchinput"&gt;   
        &lt;html:textarea property="template" cols="100" rows="10" name="sendEmailForm"&gt;
        &lt;/html:textarea&gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>This is my form bean:</p>
  
  <pre><code>private String template = null;
  public String getTemplate() {
     return template;
  }
  
  public void setTemplate(String template) {
     this.template = template;
  }
  </code></pre>
  
  <p>This is my bean:</p>
  
  <pre><code>private byte[] templateContent = null;
  
  public String getHtmlTemplateContent() {
    return templateContent.toString();
  }
  
  public byte[] getTemplateContent() {
    return templateContent;
  }
  
  public void setTemplateContent(byte[] templateContent) {
    this.templateContent = templateContent;
  }
  
  public void setTemplateContent(Object templateContent) {
    this.templateContent = (byte[])templateContent;
  }
  </code></pre>
  
  <p>This is my action:</p>
  
  <pre><code>templatesDataBean = (TemplatesDataBean)SendEmailManager.getTemplate(action, actor, sendEmailBean);
  sendEmailForm.setTemplate(new String(templatesDataBean.getHtmlTemplateContent()));
  </code></pre>
  
  <p>How can this can be solved? Thanks in advance.</p>