public void propertyChanged(String name, InputStream newValue, int length) { ByteArrayOutputStream os = new ByteArrayOutputStream(length); for(int i = 0; i < length; i++) { try { os.write(newValue.read()); } catch (IOException e) {
}   props2.retainAll(props1); for (Iterator props = props2.iterator(); props.hasNext();) { String changed = (String) props.next();  try { tmpFile1 = SVNFileUtil.createUniqueFile(myFile.getParentFile(), myFile.getName(), ".tmp1"); tmpFile2 = SVNFileUtil.createUniqueFile(myFile.getParentFile(), myFile.getName(), ".tmp2");  os = new FileOutputStream(tmpFile1); getPropertyValue(changed, os); os.close(); os = new FileOutputStream(tmpFile2); properties.getPropertyValue(changed, os); os.close(); if (tmpFile2.length() != tmpFile1.length()) { is = new FileInputStream(tmpFile2); comparator.propertyChanged(changed, is, (int) tmpFile2.length()); equals = false; is.close(); } else { is1 = new FileInputStream(tmpFile1); is2 = new FileInputStream(tmpFile2); boolean differs = false; for(int i = 0; i < tmpFile1.length(); i++) { if (is1.read() != is2.read()) { differs = true; break; } } is1.close(); is2.close(); if (differs) { is2 = new FileInputStream(tmpFile2); comparator.propertyChanged(changed, is2, (int) tmpFile2.length()); equals = false; is2.close();
    public Map compareTo(SVNProperties properties) throws SVNException {        final Map locallyChangedProperties = new HashMap();        compareTo(properties, new ISVNPropertyComparator() {            public void propertyAdded(String name, InputStream value, int length) {                propertyChanged(name, value, length);            }            public void propertyChanged(String name, InputStream newValue, int length) {                ByteArrayOutputStream os = new ByteArrayOutputStream(length);                for(int i = 0; i < length; i++) {                    try {                        os.write(newValue.read());                    } catch (IOException e) {                    }                }                byte[] bytes = os.toByteArray();                try {                    locallyChangedProperties.put(name, new String(bytes, "UTF-8"));                } catch (UnsupportedEncodingException e) {                    locallyChangedProperties.put(name, new String(bytes));                }            }            public void propertyDeleted(String name) {                locallyChangedProperties.put(name, null);            }        });        return locallyChangedProperties;            }