public static void writeHttpResponse(OutputStream out,String contentType,byte[] response) throws IOException {
  OutputStreamWriter osw=new OutputStreamWriter(out);
  writeHttpResponseHeader(osw,contentType,response.length);
  osw.flush();
  out.write(response,0,response.length);
  osw.flush();
}

public static void writeHttpResponse ( OutputStream out , String contentType , byte [ ] response ) throws IOException { OutputStreamWriter osw = new OutputStreamWriter ( out ) ; writeHttpResponseHeader ( osw , contentType , response . length ) ; osw . flush ( ) ; out . write ( response , 0 , response . length ) ; osw . flush ( ) ; }
write a byte [ ] response to the outputstream .
