jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francis Devereux (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-410) Convert InputSupplier<InputStream> methods to ByteSource
Date Fri, 17 Jan 2014 10:23:19 GMT

    [ https://issues.apache.org/jira/browse/JCLOUDS-410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13874623#comment-13874623

Francis Devereux commented on JCLOUDS-410:

The @deprecated tag for org.jclouds.blobstore.domain.BlobBuilder.payload(java.io.File) says
to use payload(Files.asByteSource(File)) instead.

I think that the new way of doing things will not work or will perform poorly for large files
but the deprecated will would work fine. This is because Files.asByteSource(File) reads the
whole file into memory(!), or fails altogether for files larger than Integer.MAX_VALUE (see
com.google.common.io.Files.FileByteSource.read()) whereas as far as I can tell the deprecated
way will stream the file and will thus work fine for huge files.

> Convert InputSupplier<InputStream> methods to ByteSource
> --------------------------------------------------------
>                 Key: JCLOUDS-410
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-410
>             Project: jclouds
>          Issue Type: Improvement
>          Components: jclouds-blobstore, jclouds-core
>    Affects Versions: 1.7.0
>            Reporter: Andrew Gaul
>            Assignee: Andrew Gaul
>             Fix For: 1.8.0
> ByteSource has convenience methods and avoids generics notational overhead.  Guava is
moving towards this:
> https://groups.google.com/forum/#!msg/guava-discuss/bChfnnXb9QA/xlmy2UzsmpsJ
> Note that ByteSource implements InputSupplier<InputStream> so we should retain
source compatibility.

This message was sent by Atlassian JIRA

View raw message