¡@

Home 

2014/10/16 ¤W¤È 08:11:10

android Programming Glossary: chunkindex

Out of memory exception due to large bitmap size

http://stackoverflow.com/questions/5321579/out-of-memory-exception-due-to-large-bitmap-size

byte List of chunk data int spaceLeft CHUNKSIZE int chunkIndex 0 DataInputStream in new DataInputStream connection.getInputStream.. end of current chunk System.arraycopy buffer 0 fixedChunk chunkIndex spaceLeft BufferChunkList.add fixedChunk create a new chunk.. and fill in the leftover fixedChunk new byte CHUNKSIZE chunkIndex bytesRead spaceLeft System.arraycopy buffer spaceLeft fixedChunk..

Out of memory exception due to large bitmap size

http://stackoverflow.com/questions/5321579/out-of-memory-exception-due-to-large-bitmap-size

1st chunk ArrayList byte BufferChunkList new ArrayList byte List of chunk data int spaceLeft CHUNKSIZE int chunkIndex 0 DataInputStream in new DataInputStream connection.getInputStream while bytesRead in.read buffer 1 loop until the DataInputStream.. is completed if bytesRead spaceLeft copy to end of current chunk System.arraycopy buffer 0 fixedChunk chunkIndex spaceLeft BufferChunkList.add fixedChunk create a new chunk and fill in the leftover fixedChunk new byte CHUNKSIZE chunkIndex.. spaceLeft BufferChunkList.add fixedChunk create a new chunk and fill in the leftover fixedChunk new byte CHUNKSIZE chunkIndex bytesRead spaceLeft System.arraycopy buffer spaceLeft fixedChunk 0 chunkIndex else plenty of space just copy it in System.arraycopy..