Package de.gebit.integrity.ui.formatting

## Class LineSeparatorDetector

- java.lang.Object
- - de.gebit.integrity.ui.formatting.LineSeparatorDetector

-     public class LineSeparatorDetector
      extends Object

  Automatically detects the line separator type used on a text file. Supports Mac OS (old), Linux/Unix and Windows-style line breaks.
  Author:
    Rene Schneider - initial API and implementation

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `LineSeparatorDetector.LineSeparatorType` | The supported line break types.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LineSeparatorDetector()` | Creates a new instance with default settings.
    `LineSeparatorDetector​(int aMaxScanSize)` | Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `LineSeparatorDetector.LineSeparatorType` | `detectLineBreakType​(InputStream aStream)` | Attempts to detect the line break type of the provided `InputStream`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LineSeparatorDetector

          public LineSeparatorDetector()

      Creates a new instance with default settings.

    - #### LineSeparatorDetector

          public LineSeparatorDetector​(int aMaxScanSize)

      Creates a new instance.
      Parameters:
        `aMaxScanSize` - the maximum bytes to scan in a file before giving up

  - ### Method Detail

    - #### detectLineBreakType

          public LineSeparatorDetector.LineSeparatorType detectLineBreakType​(InputStream aStream)
                                                                      throws IOException

      Attempts to detect the line break type of the provided `InputStream`.
      Parameters:
        `aStream` - the stream to scan
      Returns:
        the detected line break type or null if no decision could be made
      Throws:
        `IOException`