code: public static byte[] fromHex(final String string, final int offset, final int count) {
          if(offset >= string.length()) throw new IllegalArgumentException("Offset is greater than the length (" + offset + " >= " + string.length() + ").")/*by contract*/;
          if( (count & 0x01) != 0) throw new IllegalArgumentException("Count is not divisible by two (" + count + ").")/*by contract*/;
          final int charCount = Math.min((string.length() - offset), count);
          final int upperBound = offset + charCount;
  
          final byte[] bytes = new byte[charCount >>> 1/*aka /2*/];
          int byteIndex = 0/*beginning*/;
          for(int i=offset; i<upperBound; i+=2) {
              bytes[byteIndex++] = (byte)(( (digit(string.charAt(i)) << 4)
                                           | digit(string.charAt(i + 1))) & 0xFF);
          }
  
          return bytes;
      }
docs: Converts the specified array of hex characters into an array of <code>byte</code>s
  (low <code>byte</code> first).
  
  @param  string the string of hex characters to be converted into <code>byte</code>s.
  This cannot be <code>null</code> though it may be blank.
  @param  offset the offset in the string at which the characters will be
  taken.  This cannot be negative and must be less than <code>string.length() - 1</code>.
  @param  count the number of characters to be retrieved from the specified
  string.  This cannot be negative and must be divisible by two
  (since there are two characters per <code>byte</code>).
  @return the array of <code>byte</code>s that were converted from the
  specified string (in the specified range).  This will never be
  <code>null</code> though it may be empty if <code>string</code>
  is empty or <code>count</code> is zero.
  @throws IllegalArgumentException if <code>offset</code> is greater than
  or equal to <code>string.length()</code> or if <code>count</code>
  is not divisible by two.
  @see #toHex(byte[], int, int)