public class Utils { /** * Tests whether the given character is a valid space. */ public static boolean isXMLSpace(char c) { return (c <= 0x0020) && (((((1L << 0x0009) | (1L << 0x000A) | (1L << 0x000D) | (1L << 0x0020)) >> c) & 1L) != 0); } }