private static byte[] hexStringToByteArray(String s) {
        if (s == null) {
            return null;
        }
        int len = s.length();
        byte[] data = new byte[len / 2];
        for (int i = 0; i < len; i += 2) {
            data[i / 2] =
                (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16));
        }
        return data;
    }
Deserializes a geometry in the WKB format.

@param bytes A byte array representing a {@link Geometry} in WKB format or null.
@return The deserialized object or null if the byte array was null.
postgis/src/main/java/org/jdbi/v3/postgis/PostgisCodec.java