History log of /frameworks/opt/photoviewer/src/com/android/ex/photo/util/Trace.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c631b5a4b1f19f84a70b772bc879fae7c92fd4a8 13-Aug-2013 Mark Wei <markwei@google.com> Decode EXIF data from input streams.

Create new wrapper class that allows us to treat an input stream as a byte[].
We buffer the minimum number of bytes necessary to avoid unnecessary allocations
which lead to GCs.

For a 1MB image, we get:
Much less memory: 16 bytes instead of 1,048,576 bytes.
Faster, less bytes read: 76 bytes for part of the header instead of 1,048,576
bytes.
Much less GCs: 0 GCs, compared to multiple 30ms GC for allocs in my testing.

Bug: 10036191
Change-Id: Ie8b4546f157a6870b6735a36a38889fe34862c83
/frameworks/opt/photoviewer/src/com/android/ex/photo/util/Trace.java