Code example for Buffer

Methods: capacity, limit

0
		public int width;
		public int height;
		public int bpp;
 
		public boolean isValid() { 
			if (pixels == null || pixels.capacity() == 0 || pixels.limit() == 0)
				return false; 
			if (width <= 0 || height <= 0)
				return false; 
			return true; 
		} 
	} 
 
	/* 
	 * Determines whether the phone's screen is rotated. 
	 */ 
	private int getScreenRotation() { 
		WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
		Display disp = wm.getDefaultDisplay();
 
		// check whether we operate under Android 2.2 or later