Class

org.apache.daffodil.io

RegexLimitingStream

Related Doc: package io

Permalink

class RegexLimitingStream extends InputStream

Can be used with any InputStream to restrict what is read from it to stop before a particular regex match.

The regex must have a finite maximum length match string.

This can be used to forcibly stop consumption of data from a stream at a length obtained from a delimiter that is described using a regex.

The delimiter matching the regex is consumed from the underlying stream (if found), and the underlying stream is left positioned at the byte after the regex match string.

IMPORTANT: The delimiter regex cannot contain any Capturing Groups! Use (?: ... ) which is non-capturing, instead of regular ( ... ). For example: this regex matches CRLF not followed by tab or space:

"""\r\n(?!(?:\t|\ ))"""

Notice use of the ?: to avoid a capture group around the alternatives of tab or space.

Thread safety: This is inherently stateful - so not thread safe to use this object from more than one thread.

Linear Supertypes
InputStream, Closeable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RegexLimitingStream
  2. InputStream
  3. Closeable
  4. AutoCloseable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RegexLimitingStream(inputStream: InputStream, regexForDelimiter: String, maximumLengthDelimiterExample: String, charset: Charset, targetChunkSize: Int = 32 * 1024)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def available(): Int

    Permalink
    Definition Classes
    RegexLimitingStream → InputStream
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def close(): Unit

    Permalink
    Definition Classes
    RegexLimitingStream → InputStream → Closeable → AutoCloseable
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def mark(arg0: Int): Unit

    Permalink
    Definition Classes
    InputStream
  15. def markSupported(): Boolean

    Permalink
    Definition Classes
    InputStream
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def read(): Int

    Permalink
    Definition Classes
    RegexLimitingStream → InputStream
  20. def read(arg0: Array[Byte], arg1: Int, arg2: Int): Int

    Permalink
    Definition Classes
    InputStream
    Annotations
    @throws( classOf[java.io.IOException] )
  21. def read(arg0: Array[Byte]): Int

    Permalink
    Definition Classes
    InputStream
    Annotations
    @throws( classOf[java.io.IOException] )
  22. def reset(): Unit

    Permalink
    Definition Classes
    InputStream
    Annotations
    @throws( classOf[java.io.IOException] )
  23. def skip(arg0: Long): Long

    Permalink
    Definition Classes
    InputStream
    Annotations
    @throws( classOf[java.io.IOException] )
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from InputStream

Inherited from Closeable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped