code: public byte getMask(final int pIndex, final int pLength) {
  		byte ret = (byte) DEFAULT_VALUE;
  		// Add X 0 to the left
  		ret = (byte) (ret << pIndex);
  		ret = (byte) ((ret & DEFAULT_VALUE) >> pIndex);
  		// Add X 0 to the right
  		int dec = BYTE_SIZE - (pLength + pIndex);
  		if (dec > 0) {
  			ret = (byte) (ret >> dec);
  			ret = (byte) (ret << dec);
  		}
  		return ret;
  	}
docs: This method is used to get a mask dynamically
  
  @param pIndex
  start index of the mask
  @param pLength
  size of mask
  @return the mask in byte