better workaround for snappy error output
instead of setting the err stream to null, set it to a null output print stream
This commit is contained in:
parent
faa7501715
commit
c0e2eb5f5f
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.common.compress.snappy.xerial;
|
package org.elasticsearch.common.compress.snappy.xerial;
|
||||||
|
|
||||||
|
import com.google.common.io.NullOutputStream;
|
||||||
import org.xerial.snappy.Snappy;
|
import org.xerial.snappy.Snappy;
|
||||||
|
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
|
@ -37,7 +38,7 @@ public class XerialSnappy {
|
||||||
// when failing to load the snappy library, and we don't want it displayed...
|
// when failing to load the snappy library, and we don't want it displayed...
|
||||||
PrintStream err = System.err;
|
PrintStream err = System.err;
|
||||||
try {
|
try {
|
||||||
System.setErr(null);
|
System.setErr(new PrintStream(new NullOutputStream()));
|
||||||
byte[] tests = Snappy.compress("test");
|
byte[] tests = Snappy.compress("test");
|
||||||
Snappy.uncompressString(tests);
|
Snappy.uncompressString(tests);
|
||||||
availableX = true;
|
availableX = true;
|
||||||
|
|
Loading…
Reference in New Issue