/*
* If the request length exceeds the size of the output buffer,
* flush the output buffer and then write the data directly. In this
/*
* If the request length exceeds the size of the output buffer,
* flush the output buffer and then write the data directly. In this
System.arraycopy(source, sourceOffset + done, buffer, stop, now);
stop += now;
done += now;
System.arraycopy(source, sourceOffset + done, buffer, stop, now);
stop += now;
done += now;
- out.write(buffer, start, stop - start);
- bytesWritten += (stop - start);
+ if (stop > start) {
+ out.write(buffer, start, stop - start);
+ bytesWritten += (stop - start);
+ }