Mercurial > dive4elements > gnv-client
changeset 679:4eccd03394ac
Improved the copying of input stream to output stream.
gnv/trunk@816 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 22 Mar 2010 11:42:15 +0000 |
parents | 2943f69e006f |
children | ba3370dbc8c5 |
files | gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> * src/main/java/de/intevation/gnv/action/LoadAction.java: Just copy the
--- 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); } }