Home > other >  Can you tell me what's the problem with this code
Can you tell me what's the problem with this code

Time:10-07

i=1;
While (i<7) {
Byte [] data=https://bbs.csdn.net/topics/new byte [size [I]].
Len=0;
While (len & lt; The size [I]) {
Len +=dataInput. Read (data, len, size [I] - len);
}
ByteArrayOutputStream outPut=new ByteArrayOutputStream ();
BMP [I]=BitmapFactory. DecodeByteArray (data, 0, the data length);
BMP [I]. Compress (CompressFormat. PNG, 100, the outPut);
Image [I] setImageBitmap (BMP [I]);
i=i+1;
}

CodePudding user response:

While (i<7) {
Byte [] data=https://bbs.csdn.net/topics/new byte [size [I]].

Aside if nothing else, if the loop condition can perform the above 2, data are allocated memory how to control?

CodePudding user response:

Pay attention to the memory space to release after application, otherwise will be a memory leak,
  • Related