我解碼數據從ByteBuffer來像:BitmapFactory.decodeByteArray(inputData.array(), 0, inputData.limit());
BitmapFactory.decodeByteArray從ByteBuffer.array()進行解碼的數據時,則返回null
相同的代碼工作正常上較舊的Android(4.3例如),但在Android 7我收到錯誤"D/skia (14391): --- SkImageDecoder::Factory returned null"
,返回的圖像爲空。
圖像數據從jpg文件正確加載。 ByteBuffer也有正確的位置和限制。
我讀了大部分與BitmapFactory.decodeByteArray相關的類似問題,但似乎沒有一個類似於我的場景。