- protected int read(InputStream in, byte[] buffer) throws IOException {
- if (buffer.length < maxToSize || source.length < maxToSize * 2) {
+ protected int read(InputStream in, byte[] buffer, int off, int len)
+ throws IOException {
+ if (len < maxToSize || source.length < maxToSize * 2) {
boolean replaced = false;
for (int i = 0; i < froms.length; i++) {
if (froms[i] != null && froms[i].length > 0
&& StreamUtils.startsWith(froms[i], source, spos, slen)) {
if (tos[i] != null && tos[i].length > 0) {
boolean replaced = false;
for (int i = 0; i < froms.length; i++) {
if (froms[i] != null && froms[i].length > 0
&& StreamUtils.startsWith(froms[i], source, spos, slen)) {
if (tos[i] != null && tos[i].length > 0) {
- System.arraycopy(tos[i], 0, buffer, spos, tos[i].length);
+ System.arraycopy(tos[i], 0, buffer, off + spos,
+ tos[i].length);