summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-04-02 14:16:22 -0700
committerRuben Brunk <rubenbrunk@google.com>2013-04-02 14:16:22 -0700
commite3961e715d17179849901f2274e046b925b1a058 (patch)
tree9a50248cdf6012d46e39a4851dc59059e7e7e1d4 /gallerycommon/src
parentae08ffa53ee52fa78fe30d76865a05814d64984c (diff)
downloadandroid_packages_apps_Snap-e3961e715d17179849901f2274e046b925b1a058.zip
android_packages_apps_Snap-e3961e715d17179849901f2274e046b925b1a058.tar.gz
android_packages_apps_Snap-e3961e715d17179849901f2274e046b925b1a058.tar.bz2
Cleanup sloppy memory handling in ExifOutputStream.
Change-Id: Ifc34a958a6214fa89ee52cfbdeb6d53baa8cd3fd
Diffstat (limited to 'gallerycommon/src')
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java b/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
index e5a5bf0..38b34fc 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
@@ -75,6 +75,7 @@ class ExifOutputStream extends FilterOutputStream {
private int mState = STATE_SOI;
private int mByteToSkip;
private int mByteToCopy;
+ private byte[] mSingleByteArray = new byte[1];
private ByteBuffer mBuffer = ByteBuffer.allocate(4);
private final ExifInterface mInterface;
@@ -190,10 +191,8 @@ class ExifOutputStream extends FilterOutputStream {
*/
@Override
public void write(int oneByte) throws IOException {
- byte[] buf = new byte[] {
- (byte) (0xff & oneByte)
- };
- write(buf);
+ mSingleByteArray[0] = (byte) (0xff & oneByte);
+ write(mSingleByteArray);
}
/**