Code example for Buffer

Methods: capacity, limit

0
 
	/** 
	 * tests validity of this screenshot 
	 */ 
	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()  { 
		Display disp = wm.getDefaultDisplay();
		 
		// check whether we operate under Android 2.2 or later 
		try { 
			Class<?> displayClass = disp.getClass();