mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-16 15:07:27 +00:00
StringBody: just write the bytes to the output stream
This commit is contained in:
parent
6a487ba686
commit
5f9bc347ee
@ -29,7 +29,6 @@
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Reader;
|
||||
@ -70,13 +69,7 @@ public Reader getReader() {
|
||||
@Override
|
||||
public void writeTo(final OutputStream out) throws IOException {
|
||||
Args.notNull(out, "Output stream");
|
||||
final InputStream in = new ByteArrayInputStream(this.content);
|
||||
final byte[] tmp = new byte[4096];
|
||||
int l;
|
||||
while ((l = in.read(tmp)) != -1) {
|
||||
out.write(tmp, 0, l);
|
||||
}
|
||||
out.flush();
|
||||
out.write(this.content);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user