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

Adrian Cole edited comment on JCLOUDS-410 at 10/29/14 3:24 PM:
---------------------------------------------------------------

[~frankoid] you were half-way there. Remember, no http driver natively supports 
guava types. This means converting them to ByteSource makes things like File, 
byte[], and String opaque. The previous design served two purposes.

1. Allow users to simply specify payloads for simple types. Ex. payload(bytes) 
vs payload(learnGuavaSoThatYouKnowHowToWrapBytes).
2. Pass these objects directly to the http driver layer, where special case 
entities can deal with common payloads. Ex. This PR reverted apachehc's ability 
to special case byte arrays, which are obviously already buffered and many http 
drivers can support this better than streams.

https://github.com/jclouds/jclouds/pull/592


was (Author: adriancole):
[~frankoid] you were half-way there. Remember, no http driver natively supports 
guava types. This means converting them to ByteSource makes things like File, 
byte[], and String opaque. The previous design served to purposes.

1. Allow users to simply specify payloads for simple types. Ex. payload(bytes) 
vs payload(learnGuavaSoThatYouKnowHowToWrapBytes).
2. Pass these objects directly to the http driver layer, where special case 
entities can deal with common payloads. Ex. This PR reverted apachehc's ability 
to special case byte arrays, which are obviously already buffered and many http 
drivers can support this better than streams.

https://github.com/jclouds/jclouds/pull/592

> 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: Adrian Cole
>             Fix For: 2.0.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
(v6.3.4#6332)

Reply via email to