# HG changeset patch # User Ingo Weinzierl # Date 1269258135 0 # Node ID 4eccd03394acaee1d4cce00349ffc89a279807e7 # Parent 2943f69e006fa155ab7ae4b14d7a1fb85a149cd6 Improved the copying of input stream to output stream. gnv/trunk@816 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 2943f69e006f -r 4eccd03394ac gnv/ChangeLog --- a/gnv/ChangeLog Mon Mar 22 10:15:33 2010 +0000 +++ b/gnv/ChangeLog Mon Mar 22 11:42:15 2010 +0000 @@ -1,3 +1,8 @@ +2010-03-22 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Improved the copying of input stream to output stream a bit. + 2010-03-22 Ingo Weinzierl * src/main/java/de/intevation/gnv/action/LoadAction.java: Just copy the diff -r 2943f69e006f -r 4eccd03394ac gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Mon Mar 22 10:15:33 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Mon Mar 22 11:42:15 2010 +0000 @@ -741,8 +741,10 @@ reader = new InputStreamReader(in); writer = new OutputStreamWriter(out); - while (reader.ready()) { - writer.write(reader.read()); + int c; + char[] buffer = new char[512]; + while ((c = reader.read(buffer)) > 0) { + writer.write(buffer, 0, c); } }