Mercurial > dive4elements > http-client
changeset 94:31dc80c48936 3.0.16
issue1494: If encoding is set in collectionOut, use it.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 25 Sep 2013 10:40:39 +0200 |
parents | 30b7ca3951c7 |
children | bacb661e6d3d |
files | src/main/java/org/dive4elements/artifacts/httpclient/http/HttpClientImpl.java |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/org/dive4elements/artifacts/httpclient/http/HttpClientImpl.java Wed Sep 25 10:39:59 2013 +0200 +++ b/src/main/java/org/dive4elements/artifacts/httpclient/http/HttpClientImpl.java Wed Sep 25 10:40:39 2013 +0200 @@ -493,8 +493,14 @@ try { InputStream stream = collectionOut(doc, uuid, type); - byte[] b = new byte[4096]; + // Transcode if charset is given. + if (charset != null) { + collectionOutEnc(stream, out); + return; + } + try { + byte[] b = new byte[4096]; int i; while ((i = stream.read(b)) >= 0) { out.write(b, 0, i);