Skip to content

Commit fb66fa6

Browse files
committed
fixed issue with fetching files from the web ui
1 parent 9c94c33 commit fb66fa6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/main/java/de/unirostock/sems/cbarchive/web

src/main/java/de/unirostock/sems/cbarchive/web/Tools.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ else if( vcard1 == null || vcard2 == null )
401401

402402
/**
403403
* Copies an InputStream into an OutputStream and closes all streams afterwards.
404-
* Stops at max lengt.
404+
* Stops at max length.
405405
*
406406
* @param input
407407
* @param output
@@ -413,8 +413,8 @@ public static long copyStream( InputStream input, OutputStream output, long maxL
413413

414414
byte[] buffer = new byte[Fields.DEFAULT_BUFFER_SIZE];
415415
long copied = 0;
416-
while( input.available() > 0 ) {
417-
int red = input.read(buffer);
416+
int red = 0;
417+
while( (red = input.read(buffer)) != -1 ) {
418418
output.write(buffer, 0, red);
419419

420420
copied = copied + red;

0 commit comments

Comments
 (0)