Buggy code:
public class BitmapFactory { private static final int DECODE_BUFFER_SIZE = 16 * 1024 ; public static class Options { public Options ( ) { } public Bitmap inBitmap ; @ SuppressWarnings ( { "UnusedDeclaration" } ) public boolean inMutable ; public boolean inJustDecodeBounds ; public int inSampleSize ; public Config inPreferredConfig = Config . ARGB_8888 ; public boolean inPremultiplied ; public boolean inDither ; public int inDensity ; public int inTargetDensity ; public int inScreenDensity ; public boolean inScaled ; @ Deprecated public boolean inPurgeable ; @ Deprecated public boolean inInputShareable ; public boolean inPreferQualityOverSpeed ; public int outWidth ; public int outHeight ; public String outMimeType ; public byte [ ] inTempStorage ; private native void requestCancel ( ) { } public boolean mCancel ; public void requestCancelDecode ( ) { } } public static Bitmap decodeFile ( String pathName , BitmapFactory . Options opts ) { } public static Bitmap decodeFile ( String pathName , BitmapFactory . Options opts , boolean consumeRights ) { } public static Bitmap decodeFile ( String pathName ) { } public static Bitmap decodeResourceStream ( Resources res , TypedValue value , InputStream is , Rect pad , BitmapFactory . Options opts ) { } public static Bitmap decodeResourceStream ( Resources res , TypedValue value , InputStream is , Rect pad , BitmapFactory . Options opts , boolean consumeRights ) { } public static Bitmap decodeResource ( Resources res , int id , BitmapFactory . Options opts ) { } public static Bitmap decodeResource ( Resources res , int id , BitmapFactory . Options opts , boolean consumeRights ) { } public static Bitmap decodeResource ( Resources res , int id ) { } public static Bitmap decodeResource ( Resources res , int id , boolean consumeRights ) { } public static Bitmap decodeByteArray ( byte [ ] data , int offset , int length , BitmapFactory . Options opts ) { } public static Bitmap decodeByteArray ( byte [ ] data , int offset , int length , BitmapFactory . Options opts , boolean consumeRights ) { } public static Bitmap decodeByteArray ( byte [ ] data , int offset , int length ) { } public static Bitmap decodeByteArray ( byte [ ] data , int offset , int length , boolean consumeRights ) { } private static void setDensityFromOptions ( Bitmap outputBitmap , BitmapFactory . Options opts ) { } public static Bitmap decodeStream ( InputStream is , Rect outPadding , BitmapFactory . Options opts ) { } public static Bitmap decodeStream ( InputStream is , Rect outPadding , BitmapFactory . Options opts , boolean consumeRights ) { } private static Bitmap decodeStreamInternal ( InputStream is , Rect outPadding , BitmapFactory . Options opts , boolean consumeRights ) { byte [ ] tempStorage = null ; if ( opts != null ) tempStorage = opts . inTempStorage ; if ( tempStorage == null ) tempStorage = new byte [ BitmapFactory . DECODE_BUFFER_SIZE ] ; <START_BUG> return BitmapFactory . nativeDecodeStream ( is , tempStorage , outPadding , opts , true ) ; <END_BUG> } public static Bitmap decodeStream ( InputStream is ) { } public static Bitmap decodeFileDescriptor ( FileDescriptor fd , Rect outPadding , BitmapFactory . Options opts ) { } public static Bitmap decodeFileDescriptor ( FileDescriptor fd , Rect outPadding , BitmapFactory . Options opts , boolean consumeRights ) { } public static Bitmap decodeFileDescriptor ( FileDescriptor fd ) { } private static native Bitmap nativeDecodeStream ( InputStream is , byte [ ] storage , Rect padding , BitmapFactory . Options opts , boolean consumeRights ) { } private static native Bitmap nativeDecodeFileDescriptor ( FileDescriptor fd , Rect padding , BitmapFactory . Options opts , boolean consumeRights ) { } private static native Bitmap nativeDecodeAsset ( long asset , Rect padding , BitmapFactory . Options opts , boolean consumeRights ) { } private static native Bitmap nativeDecodeByteArray ( byte [ ] data , int offset , int length , BitmapFactory . Options opts , boolean consumeRights ) { } private static native boolean nativeIsSeekable ( FileDescriptor fd ) { } }

Fix:
return BitmapFactory . nativeDecodeStream ( is , tempStorage , outPadding , opts , consumeRights ) ;