SOLR-1053 -- IndexOutOfBoundsException in SolrWriter.getResourceAsString when size of data-config.xml is a multiple of 1024 bytes

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@751696 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-03-09 14:55:40 +00:00
parent 8fddbedebc
commit 15a9d6b543
2 changed files with 5 additions and 4 deletions

View File

@ -161,6 +161,10 @@ Bug Fixes
21.SOLR-1042: Fix memory leak in DIH by making TemplateString non-static member in VariableResolverImpl 21.SOLR-1042: Fix memory leak in DIH by making TemplateString non-static member in VariableResolverImpl
(Ryuuichi Kumai via shalin) (Ryuuichi Kumai via shalin)
22.SOLR-1053: IndexOutOfBoundsException in SolrWriter.getResourceAsString when size of data-config.xml is a
multiple of 1024 bytes.
(Herb Jiang via shalin)
Documentation Documentation
---------------------- ----------------------

View File

@ -192,11 +192,8 @@ public class SolrWriter {
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int sz = 0; int sz = 0;
try { try {
while (true) { while ((sz = in.read(buf)) != -1) {
sz = in.read(buf);
baos.write(buf, 0, sz); baos.write(buf, 0, sz);
if (sz < buf.length)
break;
} }
} finally { } finally {
try { try {