android - Why does SKIA not use a custom FilterInputStream? -
i'm trying decode bitmap extended filterinputstream. have perform on-the-fly byte manipulation image info provide decodable image skia, seems skia ignores custom inputstream , initializes 1 of own...
when run test application, attempting load in 2mb big jpeg results in obfuscatedinputstream.read([])
beingness called 1 time bitmapfactory.decodestream()
it seems 1 time type of file determined first 16kb of info retrieved obfuscatedinputstream
initializes own native stream , reads that, rendering changes create how input stream should work useless...
here buffered read function in extended filterinputstream class. log.d @ top of function executed once.
@override public int read(byte b[], int off, int len) throws ioexception { log.d(tag, "called read[] aval + " + super.available() + " len " + len); int numbytesread = -1; if (pos == 0) { numbytesread = fill(b); if (numbytesread < len) { int j; numbytesread += ((j = super.read(b, numbytesread, len - numbytesread)) == -1) ? 0 : j ; } } else numbytesread = super.read(b, 0, len); if (numbytesread > -1) pos += numbytesread; log.d(tag, "actually read " + numbytesread); homecoming numbytesread; }
has ever encountered issue? seems way desired behavior rewrite portions of skia library... know point of inputstream parameter if native implementation initializes stream of own...
turns out wasnt able observe actual image first 1024 bytes takes in. if doesnt observe file actual image, not bother decoding rest, hence having read[] called once.
android bitmap inputstream skia
No comments:
Post a Comment