Class PortUtil


  • public class PortUtil
    extends java.lang.Object
    This file is a helper class for internal usage only. Be aware that its API and functionality may be changed in the future.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PortUtil()
      Instantiates a PortUtil instance.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.regex.Pattern createRegexPatternWithDotMatchingNewlines​(java.lang.String regex)
      By default "." symbol in regular expressions does not match line terminators.
      static java.io.Reader wrapInBufferedReader​(java.io.Reader inputStreamReader)
      Wraps a Reader instance in a BufferedReader.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PortUtil

        private PortUtil()
        Instantiates a PortUtil instance.
    • Method Detail

      • wrapInBufferedReader

        public static java.io.Reader wrapInBufferedReader​(java.io.Reader inputStreamReader)
        Wraps a Reader instance in a BufferedReader.
        Parameters:
        inputStreamReader - the original reader
        Returns:
        the buffered reader
      • createRegexPatternWithDotMatchingNewlines

        public static java.util.regex.Pattern createRegexPatternWithDotMatchingNewlines​(java.lang.String regex)
        By default "." symbol in regular expressions does not match line terminators. The issue is more complicated by the fact that "." does not match only "\n" in C#, while it does not match several other characters as well in Java. This utility method creates a pattern in which dots match any character, including line terminators
        Parameters:
        regex - regular expression string
        Returns:
        pattern in which dot characters match any Unicode char, including line terminators