src/share/classes/java/util/zip/DeflaterOutputStream.java
Print this page
*** 204,224 ****
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
if (!def.finished()) {
! // Deflate no more than stride bytes at a time. This avoids
! // excess copying in deflateBytes (see Deflater.c)
! int stride = buf.length;
! for (int i = 0; i < len; i+= stride) {
! def.setInput(b, off + i, Math.min(stride, len - i));
while (!def.needsInput()) {
deflate();
}
}
}
- }
/**
* Finishes writing compressed data to the output stream without closing
* the underlying stream. Use this method when applying multiple filters
* in succession to the same output stream.
--- 204,219 ----
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
if (!def.finished()) {
! def.setInput(b, off, len);
while (!def.needsInput()) {
deflate();
}
}
}
/**
* Finishes writing compressed data to the output stream without closing
* the underlying stream. Use this method when applying multiple filters
* in succession to the same output stream.