int index = 0; while(index < toDecode.length() && Character.isWhitespace(toDecode.charAt(index))) { index++; } if  (index > 0) { toDecode = toDecode.delete(0, index); } index = toDecode.length() - 1; while(index >= 0 && Character.isWhitespace(toDecode.charAt(index))) { toDecode.delete(index, toDecode.length()); index--; }
    public void characters(char[] ch, int start, int length) throws SAXException {        if (myIsDeltaProcessing) {            int offset = start;                        for(int i = start; i < start + length; i++) {                if (ch[i] == '\r' || ch[i] == '\n') {                    eolCount++;                    myDeltaOutputStream.append(ch, offset, i - offset);                    offset = i + 1;                    if (i + 1 < (start + length) && ch[i + 1] == '\n') {                        offset++;                        i++;                    }                }            }            if (offset < start + length) {                myDeltaOutputStream.append(ch, offset, start + length - offset);            }            // decode (those dividable by 4)             int stored = myDeltaOutputStream.length();            if (stored < 4) {                return;            }            int segmentsCount = stored/4;            int remains = stored - (segmentsCount*4);                        StringBuffer toDecode = new StringBuffer();            toDecode.append(myDeltaOutputStream);            toDecode.delete(myDeltaOutputStream.length() - remains, myDeltaOutputStream.length());                        byte[] decoded = SVNBase64.base64ToByteArray(toDecode, null);            myPreviousStream = new SequenceIntputStream(decoded, myPreviousStream);            try {                while(true) {                    boolean needsMore = myDiffBuilder.accept(myPreviousStream, getEditor(), getCurrentPath());                    if (needsMore && myPreviousStream.available() > 0) {                        continue;                    }                    break;                }                // delete saved bytes.            } catch (SVNException e) {                throw new SAXException(e);            }            myDeltaOutputStream.delete(0, toDecode.length());        } else {            super.characters(ch, start, length);        }    }