artiya4u / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

Efficient ByteArrayContent.writeTo() implementation #217

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

http://javadoc.google-http-java-client.googlecode.com/hg/1.14.1-beta/com/google/
api/client/http/ByteArrayContent.html

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

All

Please describe the feature requested.

ByteArrayContent should override the writeTo() implementation for a faster 
implementation that avoids copying the input array in 4KB chunks into another 
byte[], which is how ByteStreams.copy(InputStream, OutputStream) is 
implemented.  We should investigate if we still need to chunk the writes to the 
OutputStream.  We should also investigate if there are any other 
AbstractInputStreamContent that can be similarly optimized.

Original issue reported on code.google.com by yan...@google.com on 22 Apr 2013 at 9:45