Commit e07223f7 authored by agurov's avatar agurov

Reduce I/O amount produced by FileReplaceListener (bug 473193)

https://bugs.eclipse.org/bugs/show_bug.cgi?id=473193

git-svn-id: https://dev.eclipse.org/svnroot/technology/org.eclipse.subversive/trunk@21498 ee007c2a-0a25-0410-9ab9-bf268980928c
parent c2ebbc86
......@@ -162,10 +162,10 @@ public class FileReplaceListener implements IResourceChangeListener {
public void write(byte b[], int off, int len) throws IOException {
byte []b1 = b;
if (b.length != len || off != 0) {
if (b.length != len) {
b1 = Arrays.copyOfRange(b, off, off + len);
}
if (this.buffer == null || this.buffer.length != len) {
if (this.buffer == null || this.buffer.length != b1.length) {
this.buffer = new byte[b1.length];
}
this.stream.read(this.buffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment