Package de.gebit.integrity.ui.formatting
Class LineSeparatorDetector
- java.lang.Object
-
- de.gebit.integrity.ui.formatting.LineSeparatorDetector
-
public class LineSeparatorDetector extends java.lang.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(java.io.InputStream aStream)
Attempts to detect the line break type of the providedInputStream
.
-
-
-
Method Detail
-
detectLineBreakType
public LineSeparatorDetector.LineSeparatorType detectLineBreakType(java.io.InputStream aStream) throws java.io.IOException
Attempts to detect the line break type of the providedInputStream
.- Parameters:
aStream
- the stream to scan- Returns:
- the detected line break type or null if no decision could be made
- Throws:
java.io.IOException
-
-