mirror of https://github.com/apache/druid.git
use IOUtils.toString in getTaskAsString
This commit is contained in:
parent
5f1f4424eb
commit
f9a64f31f3
|
@ -28,7 +28,6 @@ import org.joda.time.Interval;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
public abstract class AbstractIndexerTest
|
||||
|
@ -74,10 +73,13 @@ public abstract class AbstractIndexerTest
|
|||
|
||||
protected String getTaskAsString(String file) throws IOException
|
||||
{
|
||||
InputStream inputStream = ITRealtimeIndexTaskTest.class.getResourceAsStream(file);
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(inputStream, writer, "UTF-8");
|
||||
return writer.toString();
|
||||
final InputStream inputStream = ITRealtimeIndexTaskTest.class.getResourceAsStream(file);
|
||||
try {
|
||||
return IOUtils.toString(inputStream, "UTF-8");
|
||||
}
|
||||
finally {
|
||||
IOUtils.closeQuietly(inputStream);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue