code: public static byte[] declareStorage( Bitmap input , byte[] storage ) {
  		int byteCount = input.getConfig() == Bitmap.Config.ARGB_8888 ? 4 : 2;
  		int length = input.getWidth()*input.getHeight()*byteCount;
  		
  		if( storage == null || storage.length < length )
  			return new byte[ length ];
  		return storage;
  	}
docs: Declares a storage array for the provided Bitmap image.  The array will be
  of size = width*height*byteCount where byteCount is the number of bytes per
  pixel.
  
  @param input Bitmap image.
  @param storage If not null then the array size will be checked, if too small a new array will be returned.
  @return An array of appropriate size.