Class StringUtils.WhiteSpaceTrimmingInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    StringUtils

    public static class StringUtils.WhiteSpaceTrimmingInputStream
    extends java.io.InputStream
    Replaces any chunk of whitespace characters within a text stream, with a single space character.

    Provides an option to retain any boundary characters or treat them as whitespace.

    See Also:
    StringUtils.BOUNDARY_CHARACTER
    • Constructor Summary

      Constructors 
      Constructor Description
      WhiteSpaceTrimmingInputStream​(java.io.InputStream stream, boolean keepBoundaryChars)
      Creates a whitespace trimming input stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int read()
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • WhiteSpaceTrimmingInputStream

        public WhiteSpaceTrimmingInputStream​(java.io.InputStream stream,
                                             boolean keepBoundaryChars)
        Creates a whitespace trimming input stream.
        Parameters:
        stream - the text stream to wrap
        keepBoundaryChars - if true, any encountered boundary characters are retained, otherwise treated as whitespace and compressed
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException