| android Programming Glossary: spaceleftOut of memory exception due to large bitmap size http://stackoverflow.com/questions/5321579/out-of-memory-exception-due-to-large-bitmap-size  BufferChunkList new ArrayList byte List of chunk data  int spaceLeft CHUNKSIZE  int chunkIndex 0  DataInputStream in new DataInputStream.. loop until the DataInputStream is completed  if bytesRead spaceLeft  copy to end of current chunk  System.arraycopy buffer 0 fixedChunk.. chunk  System.arraycopy buffer 0 fixedChunk chunkIndex spaceLeft  BufferChunkList.add fixedChunk  create a new chunk and fill.. 
 Out of memory exception due to large bitmap size http://stackoverflow.com/questions/5321579/out-of-memory-exception-due-to-large-bitmap-size  new byte CHUNKSIZE initialize 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.. 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.. 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.. 
 |