ich verschlüsseln, dann ein Bild entschlüsseln, die ich dann util zum Ändern der Größe, (Code gnädig von irgendwo geliehen) wie so zu meinem Bild passieren:BitmapFactory kann keine CipherInputStream dekodieren zweimal
public static Bitmap loadResizedBitmap(InputStream dis, int width, int height) {
BufferedInputStream bis = new BufferedInputStream(dis);
Bitmap bitmap = null;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeStream(bis, null, options);
if (options.outHeight > 0 && options.outWidth > 0) {
options.inJustDecodeBounds = false;
options.inSampleSize = 2;
while (options.outWidth/options.inSampleSize > width &&
options.outHeight/options.inSampleSize > height) {
options.inSampleSize++;
}
options.inSampleSize--;
bitmap = BitmapFactory.decodeStream(bis, null, options);
}
return bitmap;
}
Das Problem während des zweiten ist decodeStream, die BitmapFactory gibt null zurück. Ich habe überprüft, das erste funktioniert, und gibt die richtige Größe, etc. Meine Vermutung ist, dass CipherInputStream Mark-und Reset nicht unterstützt, so dass ich es in einem BufferedInputStream ohne Glück gewickelt. Hat jemand andere Vorschläge?
Vergessen Sie nicht, Ihre eigene Antwort zu akzeptieren. :-) –
..ah danke. In zwei Tagen, anscheinend. –