Skip buffer in StreamUtils#copy(String)
This commit is contained in:
parent
e24954068a
commit
54f87f1ff7
|
@ -23,8 +23,6 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.OutputStreamWriter;
|
|
||||||
import java.io.Writer;
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
@ -133,9 +131,8 @@ public abstract class StreamUtils {
|
||||||
Assert.notNull(charset, "No Charset specified");
|
Assert.notNull(charset, "No Charset specified");
|
||||||
Assert.notNull(out, "No OutputStream specified");
|
Assert.notNull(out, "No OutputStream specified");
|
||||||
|
|
||||||
Writer writer = new OutputStreamWriter(out, charset);
|
out.write(in.getBytes(charset));
|
||||||
writer.write(in);
|
out.flush();
|
||||||
writer.flush();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue