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 classLineSeparatorDetector.LineSeparatorTypeThe 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.LineSeparatorTypedetectLineBreakType(InputStream aStream)Attempts to detect the line break type of the providedInputStream.
-
-
-
Method Detail
-
detectLineBreakType
public LineSeparatorDetector.LineSeparatorType detectLineBreakType(InputStream aStream) throws 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:
IOException
-
-