From: David ‘Bombe’ Roden Date: Thu, 17 Jan 2013 14:21:13 +0000 (+0100) Subject: Replace utils’ StreamCopier by Guava’s ByteStreams. X-Git-Tag: 0.8.5^2~3^2~70 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0facc7dc37d9ef2b0d6c311e3ba28697c895810e;p=Sone.git Replace utils’ StreamCopier by Guava’s ByteStreams. --- 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;