dnrajugade / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Add ByteStreams.readBytes on single InputStream #1225

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
ByteStreams.readBytes(InputStream, ByteProcessor<T> processor)
                   throws IOException

currently using 

return ByteStreams.readBytes(new InputSupplier<InputStream>() {
   @Override
   public InputStream getInput() throws IOException {
     return c.getInputStream();
   }
  }, processor);

My problem with this is that 'c' is an HttpUrlConnection.  However, I'm 
creating a supplier of InputStreams on something that cannot create more than 
one InputStream

Original issue reported on code.google.com by pjul...@gmail.com on 10 Dec 2012 at 4:11

GoogleCodeExporter commented 9 years ago
Thanks for the report. This change is in: 
http://code.google.com/p/guava-libraries/source/detail?r=43a8a98499e2782c31e489d
e7df682fe9def4bf5

We definitely want to avoid cases where there's something you can do with a 
supplier that you can't easily do with a raw stream.

Original comment by cgdecker@google.com on 11 Dec 2012 at 5:47

GoogleCodeExporter commented 9 years ago
Thank you very much

Original comment by pjul...@gmail.com on 11 Dec 2012 at 8:58

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08