code: public static int getByteCount(Bitmap bitmap) {
          int result;
  
          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
              result = BitmapHoneycombMR1.getByteCount(bitmap);
          } else {
              result = bitmap.getRowBytes() * bitmap.getHeight();
          }
  
          if (result < 0) {
              throw new IllegalStateException("Negative size: " + bitmap);
          }
  
          return result;
      }
docs: Copied from Picasso: http://square.github.io/picasso Copyright (C) 2013 Square, Inc.
  
  @param bitmap
  @return the size of the specified bitmap in bytes.