public class LineEnds
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.util.ResourceBundle |
labels
Locale specific strings displayed to the user.
|
static int |
STYLE_DOS
The Windows and DOS line ending ("\r\n")
|
static int |
STYLE_JAVA
The UNIX and Java line ending ("\n")
|
static int |
STYLE_MAC
The MacIntosh line ending ("\r")
|
static int |
STYLE_N
The UNIX and Java line ending ("\n")
|
static int |
STYLE_R
The MacIntosh line ending ("\r")
|
static int |
STYLE_RN
The Windows and DOS line ending ("\r\n")
|
static int |
STYLE_SYSTEM
The system line ending as determined
by System.getProperty("line.separator")
|
static int |
STYLE_UNIX
The UNIX and Java line ending ("\n")
|
static int |
STYLE_WINDOWS
The Windows and DOS line ending ("\r\n")
|
static java.lang.String |
version
Version number of this program
|
Constructor and Description |
---|
LineEnds() |
Modifier and Type | Method and Description |
---|---|
static boolean |
convert(java.io.File f)
Change the line endings on given file.
|
static boolean |
convert(java.io.File f,
boolean binaryException)
Change the line endings on given file.
|
static boolean |
convert(java.io.File f,
int style)
Change the line endings on given file.
|
static boolean |
convert(java.io.File f,
int style,
boolean binaryException)
Change the line endings on given file.
|
static boolean |
convert(java.io.InputStream in,
java.io.OutputStream out)
Change the line endings of the text on the input stream and write
it to the output stream.
|
static boolean |
convert(java.io.InputStream in,
java.io.OutputStream out,
boolean binaryException)
Change the line endings of the text on the input stream and write
it to the output stream.
|
static boolean |
convert(java.io.InputStream in,
java.io.OutputStream out,
int style)
Change the line endings of the text on the input stream and write
it to the output stream.
|
static boolean |
convert(java.io.InputStream in,
java.io.OutputStream out,
int style,
boolean binaryException)
Change the line endings of the text on the input stream and write
it to the output stream.
|
static void |
main(java.lang.String[] args)
Converts the line ending on files, or standard input.
|
public static final java.lang.String version
protected static java.util.ResourceBundle labels
public static final int STYLE_SYSTEM
public static final int STYLE_WINDOWS
public static final int STYLE_DOS
public static final int STYLE_RN
public static final int STYLE_UNIX
public static final int STYLE_N
public static final int STYLE_JAVA
public static final int STYLE_MAC
public static final int STYLE_R
public static void main(java.lang.String[] args)
args
- Command line arguments.public static boolean convert(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
in
- stream that contains the text which needs line number conversion.out
- stream where converted text is written.BinaryDataException
- if non-text data is encountered.java.io.IOException
- if an input or output error occurs.public static boolean convert(java.io.InputStream in, java.io.OutputStream out, int style) throws java.io.IOException
in
- stream that contains the text which needs line number conversion.out
- stream where converted text is written.style
- line separator style.BinaryDataException
- if non-text data is encountered.java.io.IOException
- if an input or output error occurs.java.lang.IllegalArgumentException
- if an unknown style is requested.public static boolean convert(java.io.InputStream in, java.io.OutputStream out, boolean binaryException) throws java.io.IOException
in
- stream that contains the text which needs line number conversion.out
- stream where converted text is written.binaryException
- throw an exception and abort the operation if binary data is encountered and binaryExcepion is false.BinaryDataException
- if non-text data is encountered.java.io.IOException
- if an input or output error occurs.public static boolean convert(java.io.InputStream in, java.io.OutputStream out, int style, boolean binaryException) throws java.io.IOException
in
- stream that contains the text which needs line number conversion.out
- stream where converted text is written.style
- line separator style.binaryException
- throw an exception and abort the operation if binary data is encountered and binaryExcepion is false.BinaryDataException
- if non-text data is encountered.java.io.IOException
- if an input or output error occurs.java.lang.IllegalArgumentException
- if an unknown style is requested.public static boolean convert(java.io.File f) throws java.io.IOException
f
- File to be converted.BinaryDataException
- if non-text data is encountered.java.io.IOException
- if an input or output error occurs.public static boolean convert(java.io.File f, int style) throws java.io.IOException
f
- File to be converted.style
- line separator style.BinaryDataException
- if non-text data is encountered.java.io.IOException
- if an input or output error occurs.java.lang.IllegalArgumentException
- if an unknown style is requested.public static boolean convert(java.io.File f, boolean binaryException) throws java.io.IOException
f
- File to be converted.binaryException
- throw an exception and abort the operation if binary data is encountered and binaryExcepion is false.BinaryDataException
- if non-text data is encountered.java.io.IOException
- if an input or output error occurs.public static boolean convert(java.io.File f, int style, boolean binaryException) throws java.io.IOException
f
- File to be converted.style
- line separator style.binaryException
- throw an exception and abort the operation if binary data is encountered and binaryExcepion is false.BinaryDataException
- if non-text data is encountered.java.io.IOException
- if an input or output error occurs.java.lang.IllegalArgumentException
- if an unknown style is requested.Copyright (c) 2001-2020 by Stephen Ostermiller