Commit eb197202 authored by Andrea Aime's avatar Andrea Aime
Browse files

[GEOS-7346] WPS cancelling output stream ends up writing a single byte at a time

parent e58875e0
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
......@@ -74,7 +74,7 @@ abstract class LimitedOutputStream extends FilterOutputStream {
* @see java.io.FilterInputStream#in
*/
public void write(int b) throws IOException {
super.write(b);
out.write(b);
count++;
checkLimit();
}
......@@ -94,7 +94,7 @@ abstract class LimitedOutputStream extends FilterOutputStream {
* @see java.io.FilterInputStream#in
*/
public void write(byte[] b, int off, int len) throws IOException {
super.write(b, off, len);
out.write(b, off, len);
if (len > 0) {
count += len;
checkLimit();
......
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
......@@ -30,7 +30,7 @@ class CancellingOutputStream extends FilterOutputStream {
@Override
public void write(byte[] b) throws IOException {
checkCancelled();
super.write(b);
out.write(b);
}
private void checkCancelled() {
......@@ -42,13 +42,13 @@ class CancellingOutputStream extends FilterOutputStream {
@Override
public void write(byte[] b, int off, int len) throws IOException {
checkCancelled();
super.write(b, off, len);
out.write(b, off, len);
}
@Override
public void write(int b) throws IOException {
checkCancelled();
super.write(b);
out.write(b);
}
}
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