From 0facc7dc37d9ef2b0d6c311e3ba28697c895810e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 17 Jan 2013 15:21:13 +0100 Subject: [PATCH] =?utf8?q?Replace=20utils=E2=80=99=20StreamCopier=20by=20G?= =?utf8?q?uava=E2=80=99s=20ByteStreams.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/UploadImagePage.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java b/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java index 8d40416..2800f29 100644 --- a/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UploadImagePage.java @@ -36,11 +36,13 @@ import net.pterodactylus.sone.data.TemporaryImage; import net.pterodactylus.sone.text.TextFilter; import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.io.Closer; -import net.pterodactylus.util.io.StreamCopier; import net.pterodactylus.util.logging.Logging; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; import net.pterodactylus.util.web.Method; + +import com.google.common.io.ByteStreams; + import freenet.support.api.Bucket; import freenet.support.api.HTTPUploadedFile; @@ -99,7 +101,7 @@ public class UploadImagePage extends SoneTemplatePage { imageInputStream = fileBucket.getInputStream(); /* TODO - check length */ imageDataOutputStream = new ByteArrayOutputStream((int) fileBucket.size()); - StreamCopier.copy(imageInputStream, imageDataOutputStream); + ByteStreams.copy(imageInputStream, imageDataOutputStream); } catch (IOException ioe1) { logger.log(Level.WARNING, "Could not read uploaded image!", ioe1); return; -- 2.7.4