Code example for CharArrayWriter

Methods: reset, toString

0
                    dLink.setMD5Hash(text.toString().trim());
                } else if (atr.getValue("type").equalsIgnoreCase("sha1")) {
                    dLink.setSha1Hash(text.toString().trim());
                } 
            } else if (path.equalsIgnoreCase(".metalink.files.file.resources.url")) {
                DownloadLink downloadLink = createDownloadlink(text.toString().trim());
                try { 
                    /* needed to avoid rename by plugin */ 
                    downloadLink.forceFileName(dLink.getFinalFileName());
                } catch (Throwable e) {
                    /* forceFileName not available in 0.957 public */ 
                } 
                downloadLink.setFinalFileName(dLink.getFinalFileName());
                downloadLink.setDownloadSize(dLink.getDownloadSize());
                downloadLink.setMD5Hash(dLink.getMD5Hash());
                downloadLink.setSha1Hash(dLink.getSha1Hash());
                if (publisherName != null && publisherURL != null) {
                    downloadLink.setSourcePluginComment(publisherName + " (" + publisherURL + ")");
                } else if (publisherName != null) {
                    downloadLink.setSourcePluginComment(publisherName);
                } else if (publisherURL != null) {
                    downloadLink.setSourcePluginComment(publisherURL);
                } 
                decryptedLinks.add(downloadLink);
            } 
            path = path.substring(0, path.length() - qName.length() - 1);
            text.reset();
        } 
 
        public void characters(char[] ch, int start, int length) {
            text.write(ch, start, length);
        }