List of usage examples for org.jdom2.output LineSeparator CR
LineSeparator CR
To view the source code for org.jdom2.output LineSeparator CR.
Click Source Link
From source file:org.commonjava.maven.ext.io.PomIO.java
License:Apache License
private static LineSeparator determineEOL(File pom) throws ManipulationException { try (BufferedInputStream bufferIn = new BufferedInputStream(new FileInputStream(pom))) { int prev = -1; int ch;//from w w w. ja v a2 s. com while ((ch = bufferIn.read()) != -1) { if (ch == '\n') { if (prev == '\r') { return LineSeparator.CRNL; } else { return LineSeparator.NL; } } else if (prev == '\r') { return LineSeparator.CR; } prev = ch; } throw new ManipulationException("Could not determine end-of-line marker mode"); } catch (IOException ioe) { throw new ManipulationException("Could not determine end-of-line marker mode", ioe); } }